diff --git a/clippy_lints/src/loops.rs b/clippy_lints/src/loops.rs index 63d9b7f8645..c89a0876575 100644 --- a/clippy_lints/src/loops.rs +++ b/clippy_lints/src/loops.rs @@ -885,7 +885,9 @@ fn get_span_of_entire_for_loop(expr: &Expr<'_>) -> Span { impl<'a> MinifyingSugg<'a> { fn as_str(&self) -> &str { - let Sugg::NonParen(s) | Sugg::MaybeParen(s) | Sugg::BinOp(_, s) = &self.0; + let s = match &self.0 { + Sugg::NonParen(s) | Sugg::MaybeParen(s) | Sugg::BinOp(_, s) => s, + }; s.as_ref() }