]> git.lizzy.rs Git - rust.git/blob - clippy_tests/examples/let_if_seq.stderr
382c51046b429d43f2f59396c040886fe8d3c727
[rust.git] / clippy_tests / examples / let_if_seq.stderr
1 error: `if _ { .. } else { .. }` is an expression
2   --> let_if_seq.rs:57:5
3    |
4 57 | /     let mut foo = 0;
5 58 | |     if f() {
6 59 | |         foo = 42;
7 60 | |     }
8    | |_____^ help: it is more idiomatic to write `let <mut> foo = if f() { 42 } else { 0 };`
9    |
10    = note: `-D useless-let-if-seq` implied by `-D warnings`
11    = note: you might not need `mut` at all
12
13 error: `if _ { .. } else { .. }` is an expression
14   --> let_if_seq.rs:62:5
15    |
16 62 | /     let mut bar = 0;
17 63 | |     if f() {
18 64 | |         f();
19 65 | |         bar = 42;
20 ...  |
21 68 | |         f();
22 69 | |     }
23    | |_____^ help: it is more idiomatic to write `let <mut> bar = if f() { ..; 42 } else { ..; 0 };`
24    |
25    = note: `-D useless-let-if-seq` implied by `-D warnings`
26    = note: you might not need `mut` at all
27
28 error: `if _ { .. } else { .. }` is an expression
29   --> let_if_seq.rs:71:5
30    |
31 71 | /     let quz;
32 72 | |     if f() {
33 73 | |         quz = 42;
34 74 | |     } else {
35 75 | |         quz = 0;
36 76 | |     }
37    | |_____^ help: it is more idiomatic to write `let quz = if f() { 42 } else { 0 };`
38    |
39    = note: `-D useless-let-if-seq` implied by `-D warnings`
40
41 error: `if _ { .. } else { .. }` is an expression
42    --> let_if_seq.rs:100:5
43     |
44 100 | /     let mut baz = 0;
45 101 | |     if f() {
46 102 | |         baz = 42;
47 103 | |     }
48     | |_____^ help: it is more idiomatic to write `let <mut> baz = if f() { 42 } else { 0 };`
49     |
50     = note: `-D useless-let-if-seq` implied by `-D warnings`
51     = note: you might not need `mut` at all
52
53 error: aborting due to previous error(s)
54
55 error: Could not compile `clippy_tests`.
56
57 To learn more, run the command again with --verbose.