clean tests/ui/let_if_seq.rs

Cleaning the empty lines for clarity.
This commit is contained in:
Luis de Bethencourt 2017-05-11 12:37:32 +01:00
parent 7b2766af4a
commit 2df0161973
2 changed files with 22 additions and 43 deletions

View file

@ -55,17 +55,11 @@ fn main() {
issue985_alt();
let mut foo = 0;
if f() {
foo = 42;
}
let mut bar = 0;
if f() {
f();
bar = 42;
@ -75,10 +69,6 @@ fn main() {
}
let quz;
if f() {
quz = 42;
} else {
@ -87,7 +77,6 @@ fn main() {
// `toto` is used several times
let mut toto;
if f() {
toto = 42;
} else {
@ -109,9 +98,6 @@ fn main() {
// baz needs to be mut
let mut baz = 0;
if f() {
baz = 42;
}

View file

@ -2,12 +2,9 @@ error: `if _ { .. } else { .. }` is an expression
--> $DIR/let_if_seq.rs:57:5
|
57 | / let mut foo = 0;
58 | |
59 | |
60 | |
61 | | if f() {
62 | | foo = 42;
63 | | }
58 | | if f() {
59 | | foo = 42;
60 | | }
| |_____^ help: it is more idiomatic to write `let <mut> foo = if f() { 42 } else { 0 };`
|
note: lint level defined here
@ -18,41 +15,37 @@ note: lint level defined here
= note: you might not need `mut` at all
error: `if _ { .. } else { .. }` is an expression
--> $DIR/let_if_seq.rs:65:5
--> $DIR/let_if_seq.rs:62:5
|
65 | / let mut bar = 0;
66 | |
67 | |
68 | |
62 | / let mut bar = 0;
63 | | if f() {
64 | | f();
65 | | bar = 42;
... |
74 | | f();
75 | | }
68 | | f();
69 | | }
| |_____^ help: it is more idiomatic to write `let <mut> bar = if f() { ..; 42 } else { ..; 0 };`
|
= note: you might not need `mut` at all
error: `if _ { .. } else { .. }` is an expression
--> $DIR/let_if_seq.rs:77:5
--> $DIR/let_if_seq.rs:71:5
|
77 | / let quz;
78 | |
79 | |
80 | |
... |
85 | | quz = 0;
86 | | }
71 | / let quz;
72 | | if f() {
73 | | quz = 42;
74 | | } else {
75 | | quz = 0;
76 | | }
| |_____^ help: it is more idiomatic to write `let quz = if f() { 42 } else { 0 };`
error: `if _ { .. } else { .. }` is an expression
--> $DIR/let_if_seq.rs:111:5
--> $DIR/let_if_seq.rs:100:5
|
111 | / let mut baz = 0;
112 | |
113 | |
114 | |
115 | | if f() {
116 | | baz = 42;
117 | | }
100 | / let mut baz = 0;
101 | | if f() {
102 | | baz = 42;
103 | | }
| |_____^ help: it is more idiomatic to write `let <mut> baz = if f() { 42 } else { 0 };`
|
= note: you might not need `mut` at all