fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
1.5 KiB56 linesraw
1error: `if _ { .. } else { .. }` is an expression
2  --> $DIR/let_if_seq.rs:66:5
3   |
4LL | /     let mut foo = 0;
5LL | |
6LL | |
7LL | |     if f() {
8LL | |         foo = 42;
9LL | |     }
10   | |_____^ help: it is more idiomatic to write: `let <mut> foo = if f() { 42 } else { 0 };`
11   |
12   = note: you might not need `mut` at all
13   = note: `-D clippy::useless-let-if-seq` implied by `-D warnings`
14   = help: to override `-D warnings` add `#[allow(clippy::useless_let_if_seq)]`
15
16error: `if _ { .. } else { .. }` is an expression
17  --> $DIR/let_if_seq.rs:73:5
18   |
19LL | /     let mut bar = 0;
20LL | |
21LL | |
22LL | |     if f() {
23...  |
24LL | |         f();
25LL | |     }
26   | |_____^ help: it is more idiomatic to write: `let <mut> bar = if f() { ..; 42 } else { ..; 0 };`
27   |
28   = note: you might not need `mut` at all
29
30error: `if _ { .. } else { .. }` is an expression
31  --> $DIR/let_if_seq.rs:83:5
32   |
33LL | /     let quz;
34LL | |
35LL | |     if f() {
36LL | |         quz = 42;
37LL | |     } else {
38LL | |         quz = 0;
39LL | |     }
40   | |_____^ help: it is more idiomatic to write: `let quz = if f() { 42 } else { 0 };`
41
42error: `if _ { .. } else { .. }` is an expression
43  --> $DIR/let_if_seq.rs:113:5
44   |
45LL | /     let mut baz = 0;
46LL | |
47LL | |
48LL | |     if f() {
49LL | |         baz = 42;
50LL | |     }
51   | |_____^ help: it is more idiomatic to write: `let <mut> baz = if f() { 42 } else { 0 };`
52   |
53   = note: you might not need `mut` at all
54
55error: aborting due to 4 previous errors
56