We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6de463c commit f177835Copy full SHA for f177835
clippy_lints/src/len_zero.rs
@@ -176,12 +176,11 @@ impl<'tcx> LateLintPass<'tcx> for LenZero {
176
if let ExprKind::Let(lt) = expr.kind
177
&& match lt.pat.kind {
178
PatKind::Slice([], None, []) => true,
179
- PatKind::Expr(lit) => match lit.kind {
180
- PatExprKind::Lit { lit, .. } => match lit.node {
181
- LitKind::Str(lit, _) => lit.as_str().is_empty(),
182
- _ => false,
183
- },
184
+ PatKind::Expr(lit)
+ if let PatExprKind::Lit { lit, .. } = lit.kind
+ && let LitKind::Str(lit, _) = lit.node =>
+ {
+ lit.as_str().is_empty()
185
},
186
_ => false,
187
}
0 commit comments