clean tests/ui/len_zero.rs

Cleaning the empty lines for clarity.
This commit is contained in:
Luis de Bethencourt 2017-05-11 12:35:29 +01:00
parent 3ca67910a8
commit 7b2766af4a
2 changed files with 19 additions and 37 deletions

View File

@ -128,16 +128,10 @@ impl HasWrongIsEmpty {
fn main() {
let x = [1, 2];
if x.len() == 0 {
println!("This should not happen!");
}
if "".len() == 0 {
}
let y = One;
@ -152,30 +146,18 @@ fn main() {
let has_is_empty = HasIsEmpty;
if has_is_empty.len() == 0 {
println!("Or this!");
}
if has_is_empty.len() != 0 {
println!("Or this!");
}
if has_is_empty.len() > 0 {
println!("Or this!");
}
assert!(!has_is_empty.is_empty());
let with_is_empty: &WithIsEmpty = &Wither;
if with_is_empty.len() == 0 {
println!("Or this!");
}
assert!(!with_is_empty.is_empty());

View File

@ -59,39 +59,39 @@ note: lint level defined here
| ^^^^^^^^
error: length comparison to zero
--> $DIR/len_zero.rs:137:8
--> $DIR/len_zero.rs:134:8
|
137 | if "".len() == 0 {
134 | if "".len() == 0 {
| ^^^^^^^^^^^^^ help: using `is_empty` is more concise: `"".is_empty()`
error: length comparison to zero
--> $DIR/len_zero.rs:148:8
|
148 | if has_is_empty.len() == 0 {
| ^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is more concise: `has_is_empty.is_empty()`
error: length comparison to zero
--> $DIR/len_zero.rs:151:8
|
151 | if has_is_empty.len() != 0 {
| ^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is more concise: `!has_is_empty.is_empty()`
error: length comparison to zero
--> $DIR/len_zero.rs:154:8
|
154 | if has_is_empty.len() == 0 {
| ^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is more concise: `has_is_empty.is_empty()`
154 | if has_is_empty.len() > 0 {
| ^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is more concise: `!has_is_empty.is_empty()`
error: length comparison to zero
--> $DIR/len_zero.rs:160:8
|
160 | if has_is_empty.len() != 0 {
| ^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is more concise: `!has_is_empty.is_empty()`
error: length comparison to zero
--> $DIR/len_zero.rs:166:8
|
166 | if has_is_empty.len() > 0 {
| ^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is more concise: `!has_is_empty.is_empty()`
error: length comparison to zero
--> $DIR/len_zero.rs:175:8
|
175 | if with_is_empty.len() == 0 {
160 | if with_is_empty.len() == 0 {
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is more concise: `with_is_empty.is_empty()`
error: length comparison to zero
--> $DIR/len_zero.rs:190:8
--> $DIR/len_zero.rs:172:8
|
190 | if b.len() != 0 {
172 | if b.len() != 0 {
| ^^^^^^^^^^^^ help: using `is_empty` is more concise: `!b.is_empty()`
error: aborting due to 11 previous errors