Rust-clippy: Reword help message for len_zero

Created on 16 Oct 2018  路  2Comments  路  Source: rust-lang/rust-clippy

When calling .len() == 0 on something with a .is_empty() method, a lint is triggered with the following help message:

help: using `is_empty` is more concise: `self.buffer.is_empty()`

Mentioning concision rather than clarity is a bit misleading; .len() == 0 and .is_empty() have actually the exact same number of characters.

I suggest rewording it like this:

help: using `is_empty` is clearer and more explicit: `self.buffer.is_empty()`

(Run with clippy 0.0.212 (32b1d1f 2018-10-05))

good-first-issue

Most helpful comment

Hi I'd like to take this as my first issue.

All 2 comments

Hi I'd like to take this as my first issue.

As #3326 merged, maybe this can be closed? 馃槃

Was this page helpful?
0 / 5 - 0 ratings