Rollup merge of #118147 - Nilstrieb:no-redundant-casts, r=WaffleLapkin
Fix some unnecessary casts `x clippy compiler -Aclippy::all -Wclippy::unnecessary_cast --fix` with some manual review to ensure every fix is correct.
This commit is contained in:
commit
040151a4be
10 changed files with 18 additions and 30 deletions
|
@ -95,9 +95,7 @@ impl<'tcx> PlaceTy<'tcx> {
|
|||
ProjectionElem::Subslice { from, to, from_end } => {
|
||||
PlaceTy::from_ty(match self.ty.kind() {
|
||||
ty::Slice(..) => self.ty,
|
||||
ty::Array(inner, _) if !from_end => {
|
||||
Ty::new_array(tcx, *inner, (to - from) as u64)
|
||||
}
|
||||
ty::Array(inner, _) if !from_end => Ty::new_array(tcx, *inner, to - from),
|
||||
ty::Array(inner, size) if from_end => {
|
||||
let size = size.eval_target_usize(tcx, param_env);
|
||||
let len = size - from - to;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue