Rollup merge of #116211 - matthiaskrgr:clippy3, r=compiler-errors

more clippy complextity fixes

redundant_guards, useless_format, clone_on_copy
This commit is contained in:
Matthias Krüger
2023-09-28 09:14:06 +02:00
committed by GitHub
14 changed files with 19 additions and 24 deletions

View File

@@ -1146,10 +1146,10 @@ fn post_fmt_projection(projection: &[PlaceElem<'_>], fmt: &mut Formatter<'_>) ->
ProjectionElem::ConstantIndex { offset, min_length, from_end: true } => {
write!(fmt, "[-{offset:?} of {min_length:?}]")?;
}
ProjectionElem::Subslice { from, to, from_end: true } if to == 0 => {
ProjectionElem::Subslice { from, to: 0, from_end: true } => {
write!(fmt, "[{from:?}:]")?;
}
ProjectionElem::Subslice { from, to, from_end: true } if from == 0 => {
ProjectionElem::Subslice { from: 0, to, from_end: true } => {
write!(fmt, "[:-{to:?}]")?;
}
ProjectionElem::Subslice { from, to, from_end: true } => {