Fix comments in clippy_lints/src/len_zero.rs
This commit is contained in:
parent
da7aebc342
commit
798a419b1c
@ -31,10 +31,10 @@ use syntax::source_map::{Span, Spanned};
|
|||||||
/// ```
|
/// ```
|
||||||
/// instead use
|
/// instead use
|
||||||
/// ```rust
|
/// ```rust
|
||||||
/// if x.len().is_empty() {
|
/// if x.is_empty() {
|
||||||
/// ..
|
/// ..
|
||||||
/// }
|
/// }
|
||||||
/// if !y.len().is_empty() {
|
/// if !y.is_empty() {
|
||||||
/// ..
|
/// ..
|
||||||
/// }
|
/// }
|
||||||
/// ```
|
/// ```
|
||||||
@ -115,8 +115,8 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for LenZero {
|
|||||||
check_cmp(cx, expr.span, left, right, "", 1); // len < 1
|
check_cmp(cx, expr.span, left, right, "", 1); // len < 1
|
||||||
check_cmp(cx, expr.span, right, left, "!", 0); // 0 < len
|
check_cmp(cx, expr.span, right, left, "!", 0); // 0 < len
|
||||||
},
|
},
|
||||||
BinOpKind::Ge => check_cmp(cx, expr.span, left, right, "!", 1), // len <= 1
|
BinOpKind::Ge => check_cmp(cx, expr.span, left, right, "!", 1), // len >= 1
|
||||||
BinOpKind::Le => check_cmp(cx, expr.span, right, left, "!", 1), // 1 >= len
|
BinOpKind::Le => check_cmp(cx, expr.span, right, left, "!", 1), // 1 <= len
|
||||||
_ => (),
|
_ => (),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user