Skip to content

Commit 87e628f

Browse files
committed
Auto merge of rust-lang#4954 - JohnTitor:improve-len-zero-doc, r=llogiq
Correct documentation for `len_zero` Fixes rust-lang#4902 changelog: none
2 parents a68ef55 + ad93638 commit 87e628f

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

clippy_lints/src/len_zero.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,9 @@ declare_clippy_lint! {
1515
/// just to compare to zero, and suggests using `.is_empty()` where applicable.
1616
///
1717
/// **Why is this bad?** Some structures can answer `.is_empty()` much faster
18-
/// than calculating their length. Notably, for slices, getting the length
19-
/// requires a subtraction whereas `.is_empty()` is just a comparison. So it is
20-
/// good to get into the habit of using `.is_empty()`, and having it is cheap.
21-
/// Besides, it makes the intent clearer than a manual comparison.
18+
/// than calculating their length. So it is good to get into the habit of using
19+
/// `.is_empty()`, and having it is cheap.
20+
/// Besides, it makes the intent clearer than a manual comparison in some contexts.
2221
///
2322
/// **Known problems:** None.
2423
///

0 commit comments

Comments
 (0)