mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-24 05:33:27 +00:00
clean tests/ui/needless_return.rs
Cleaning the empty lines for clarity.
This commit is contained in:
parent
b4a20aedf9
commit
cd55b87874
2 changed files with 14 additions and 39 deletions
|
@ -9,44 +9,25 @@ fn test_end_of_fn() -> bool {
|
|||
return true;
|
||||
}
|
||||
return true;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
fn test_no_semicolon() -> bool {
|
||||
return true
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
fn test_if_block() -> bool {
|
||||
if true {
|
||||
return true;
|
||||
|
||||
|
||||
|
||||
} else {
|
||||
return false;
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
fn test_match(x: bool) -> bool {
|
||||
match x {
|
||||
true => return false,
|
||||
|
||||
|
||||
|
||||
|
||||
false => {
|
||||
return true;
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -54,14 +35,8 @@ fn test_match(x: bool) -> bool {
|
|||
fn test_closure() {
|
||||
let _ = || {
|
||||
return true;
|
||||
|
||||
|
||||
|
||||
};
|
||||
let _ = || return true;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
fn main() {
|
||||
|
|
|
@ -11,45 +11,45 @@ note: lint level defined here
|
|||
| ^^^^^^^^^^^^^^^
|
||||
|
||||
error: unneeded return statement
|
||||
--> $DIR/needless_return.rs:18:5
|
||||
--> $DIR/needless_return.rs:15:5
|
||||
|
|
||||
18 | return true
|
||||
15 | return true
|
||||
| ^^^^^^^^^^^ help: remove `return` as shown: `true`
|
||||
|
||||
error: unneeded return statement
|
||||
--> $DIR/needless_return.rs:26:9
|
||||
--> $DIR/needless_return.rs:20:9
|
||||
|
|
||||
26 | return true;
|
||||
20 | return true;
|
||||
| ^^^^^^^^^^^^ help: remove `return` as shown: `true`
|
||||
|
||||
error: unneeded return statement
|
||||
--> $DIR/needless_return.rs:31:9
|
||||
--> $DIR/needless_return.rs:22:9
|
||||
|
|
||||
31 | return false;
|
||||
22 | return false;
|
||||
| ^^^^^^^^^^^^^ help: remove `return` as shown: `false`
|
||||
|
||||
error: unneeded return statement
|
||||
--> $DIR/needless_return.rs:40:17
|
||||
--> $DIR/needless_return.rs:28:17
|
||||
|
|
||||
40 | true => return false,
|
||||
28 | true => return false,
|
||||
| ^^^^^^^^^^^^ help: remove `return` as shown: `false`
|
||||
|
||||
error: unneeded return statement
|
||||
--> $DIR/needless_return.rs:46:13
|
||||
--> $DIR/needless_return.rs:30:13
|
||||
|
|
||||
46 | return true;
|
||||
30 | return true;
|
||||
| ^^^^^^^^^^^^ help: remove `return` as shown: `true`
|
||||
|
||||
error: unneeded return statement
|
||||
--> $DIR/needless_return.rs:56:9
|
||||
--> $DIR/needless_return.rs:37:9
|
||||
|
|
||||
56 | return true;
|
||||
37 | return true;
|
||||
| ^^^^^^^^^^^^ help: remove `return` as shown: `true`
|
||||
|
||||
error: unneeded return statement
|
||||
--> $DIR/needless_return.rs:61:16
|
||||
--> $DIR/needless_return.rs:39:16
|
||||
|
|
||||
61 | let _ = || return true;
|
||||
39 | let _ = || return true;
|
||||
| ^^^^^^^^^^^ help: remove `return` as shown: `true`
|
||||
|
||||
error: aborting due to 8 previous errors
|
||||
|
|
Loading…
Reference in a new issue