1
Fork 0

don't convert types to the same type with try_into (clippy::useless_conversion)

This commit is contained in:
Matthias Krüger 2020-09-15 22:44:43 +02:00
parent a874956d94
commit f567287f9f
3 changed files with 4 additions and 9 deletions

View file

@ -33,7 +33,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
let tcx = self.hir.tcx();
let (min_length, exact_size) = match place.ty(&self.local_decls, tcx).ty.kind() {
ty::Array(_, length) => {
(length.eval_usize(tcx, self.hir.param_env).try_into().unwrap(), true)
(length.eval_usize(tcx, self.hir.param_env), true)
}
_ => ((prefix.len() + suffix.len()).try_into().unwrap(), false),
};