rust-clippy/tests/ui/len_zero.stderr

133 lines
4.6 KiB
Text
Raw Normal View History

error: length comparison to zero
--> $DIR/len_zero.rs:84:8
2018-12-27 15:57:55 +00:00
|
LL | if x.len() == 0 {
| ^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `x.is_empty()`
|
= note: `-D clippy::len-zero` implied by `-D warnings`
error: length comparison to zero
--> $DIR/len_zero.rs:88:8
2018-12-27 15:57:55 +00:00
|
LL | if "".len() == 0 {}
| ^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `"".is_empty()`
error: comparison to empty slice
--> $DIR/len_zero.rs:97:20
|
LL | println!("{}", *s1 == "");
| ^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `s1.is_empty()`
|
= note: `-D clippy::comparison-to-empty` implied by `-D warnings`
error: comparison to empty slice
--> $DIR/len_zero.rs:98:20
|
LL | println!("{}", **s2 == "");
| ^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `s2.is_empty()`
error: comparison to empty slice
--> $DIR/len_zero.rs:99:20
|
LL | println!("{}", ***s3 == "");
| ^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `s3.is_empty()`
error: comparison to empty slice
--> $DIR/len_zero.rs:100:20
|
LL | println!("{}", ****s4 == "");
| ^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `s4.is_empty()`
error: comparison to empty slice
--> $DIR/len_zero.rs:101:20
|
LL | println!("{}", *****s5 == "");
| ^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `s5.is_empty()`
error: comparison to empty slice
--> $DIR/len_zero.rs:102:20
|
LL | println!("{}", ******(s6) == "");
| ^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `(s6).is_empty()`
error: comparison to empty slice
--> $DIR/len_zero.rs:105:20
|
LL | println!("{}", &**d2s == "");
| ^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `(**d2s).is_empty()`
error: length comparison to zero
--> $DIR/len_zero.rs:120:8
2018-12-27 15:57:55 +00:00
|
LL | if has_is_empty.len() == 0 {
| ^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `has_is_empty.is_empty()`
error: length comparison to zero
--> $DIR/len_zero.rs:123:8
2018-12-27 15:57:55 +00:00
|
LL | if has_is_empty.len() != 0 {
2019-08-01 13:20:08 +00:00
| ^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!has_is_empty.is_empty()`
error: length comparison to zero
--> $DIR/len_zero.rs:126:8
2018-12-27 15:57:55 +00:00
|
LL | if has_is_empty.len() > 0 {
2019-08-01 13:20:08 +00:00
| ^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!has_is_empty.is_empty()`
error: length comparison to one
--> $DIR/len_zero.rs:129:8
2018-12-27 15:57:55 +00:00
|
LL | if has_is_empty.len() < 1 {
| ^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `has_is_empty.is_empty()`
error: length comparison to one
--> $DIR/len_zero.rs:132:8
2018-12-27 15:57:55 +00:00
|
LL | if has_is_empty.len() >= 1 {
2019-08-01 13:20:08 +00:00
| ^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!has_is_empty.is_empty()`
error: length comparison to zero
--> $DIR/len_zero.rs:143:8
2018-12-27 15:57:55 +00:00
|
LL | if 0 == has_is_empty.len() {
| ^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `has_is_empty.is_empty()`
error: length comparison to zero
--> $DIR/len_zero.rs:146:8
2018-12-27 15:57:55 +00:00
|
LL | if 0 != has_is_empty.len() {
2019-08-01 13:20:08 +00:00
| ^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!has_is_empty.is_empty()`
error: length comparison to zero
--> $DIR/len_zero.rs:149:8
2018-12-27 15:57:55 +00:00
|
LL | if 0 < has_is_empty.len() {
2019-08-01 13:20:08 +00:00
| ^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!has_is_empty.is_empty()`
error: length comparison to one
--> $DIR/len_zero.rs:152:8
2018-12-27 15:57:55 +00:00
|
LL | if 1 <= has_is_empty.len() {
2019-08-01 13:20:08 +00:00
| ^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!has_is_empty.is_empty()`
error: length comparison to one
--> $DIR/len_zero.rs:155:8
2018-12-27 15:57:55 +00:00
|
LL | if 1 > has_is_empty.len() {
| ^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `has_is_empty.is_empty()`
error: length comparison to zero
--> $DIR/len_zero.rs:169:8
2018-12-27 15:57:55 +00:00
|
LL | if with_is_empty.len() == 0 {
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `with_is_empty.is_empty()`
2017-02-25 03:26:33 +00:00
error: length comparison to zero
--> $DIR/len_zero.rs:182:8
2018-12-27 15:57:55 +00:00
|
LL | if b.len() != 0 {}
2019-08-01 13:20:08 +00:00
| ^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!b.is_empty()`
2017-02-25 03:26:33 +00:00
error: aborting due to 21 previous errors
2018-01-16 16:06:27 +00:00