1
1
error: unnecessary operation
2
- --> $DIR/unnecessary_operation.rs:54 :5
2
+ --> $DIR/unnecessary_operation.rs:70 :5
3
3
|
4
4
LL | Tuple(get_number());
5
5
| ^^^^^^^^^^^^^^^^^^^^ help: statement can be reduced to: `get_number();`
@@ -8,111 +8,111 @@ LL | Tuple(get_number());
8
8
= help: to override `-D warnings` add `#[allow(clippy::unnecessary_operation)]`
9
9
10
10
error: unnecessary operation
11
- --> $DIR/unnecessary_operation.rs:55 :5
11
+ --> $DIR/unnecessary_operation.rs:71 :5
12
12
|
13
13
LL | Struct { field: get_number() };
14
14
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: statement can be reduced to: `get_number();`
15
15
16
16
error: unnecessary operation
17
- --> $DIR/unnecessary_operation.rs:56 :5
17
+ --> $DIR/unnecessary_operation.rs:72 :5
18
18
|
19
19
LL | Struct { ..get_struct() };
20
20
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: statement can be reduced to: `get_struct();`
21
21
22
22
error: unnecessary operation
23
- --> $DIR/unnecessary_operation.rs:57 :5
23
+ --> $DIR/unnecessary_operation.rs:73 :5
24
24
|
25
25
LL | Enum::Tuple(get_number());
26
26
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: statement can be reduced to: `get_number();`
27
27
28
28
error: unnecessary operation
29
- --> $DIR/unnecessary_operation.rs:58 :5
29
+ --> $DIR/unnecessary_operation.rs:74 :5
30
30
|
31
31
LL | Enum::Struct { field: get_number() };
32
32
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: statement can be reduced to: `get_number();`
33
33
34
34
error: unnecessary operation
35
- --> $DIR/unnecessary_operation.rs:59 :5
35
+ --> $DIR/unnecessary_operation.rs:75 :5
36
36
|
37
37
LL | 5 + get_number();
38
38
| ^^^^^^^^^^^^^^^^^ help: statement can be reduced to: `5;get_number();`
39
39
40
40
error: unnecessary operation
41
- --> $DIR/unnecessary_operation.rs:60 :5
41
+ --> $DIR/unnecessary_operation.rs:76 :5
42
42
|
43
43
LL | *&get_number();
44
44
| ^^^^^^^^^^^^^^^ help: statement can be reduced to: `get_number();`
45
45
46
46
error: unnecessary operation
47
- --> $DIR/unnecessary_operation.rs:61 :5
47
+ --> $DIR/unnecessary_operation.rs:77 :5
48
48
|
49
49
LL | &get_number();
50
50
| ^^^^^^^^^^^^^^ help: statement can be reduced to: `get_number();`
51
51
52
52
error: unnecessary operation
53
- --> $DIR/unnecessary_operation.rs:62 :5
53
+ --> $DIR/unnecessary_operation.rs:78 :5
54
54
|
55
55
LL | (5, 6, get_number());
56
56
| ^^^^^^^^^^^^^^^^^^^^^ help: statement can be reduced to: `5;6;get_number();`
57
57
58
58
error: unnecessary operation
59
- --> $DIR/unnecessary_operation.rs:63 :5
59
+ --> $DIR/unnecessary_operation.rs:79 :5
60
60
|
61
61
LL | get_number()..;
62
62
| ^^^^^^^^^^^^^^^ help: statement can be reduced to: `get_number();`
63
63
64
64
error: unnecessary operation
65
- --> $DIR/unnecessary_operation.rs:64 :5
65
+ --> $DIR/unnecessary_operation.rs:80 :5
66
66
|
67
67
LL | ..get_number();
68
68
| ^^^^^^^^^^^^^^^ help: statement can be reduced to: `get_number();`
69
69
70
70
error: unnecessary operation
71
- --> $DIR/unnecessary_operation.rs:65 :5
71
+ --> $DIR/unnecessary_operation.rs:81 :5
72
72
|
73
73
LL | 5..get_number();
74
74
| ^^^^^^^^^^^^^^^^ help: statement can be reduced to: `5;get_number();`
75
75
76
76
error: unnecessary operation
77
- --> $DIR/unnecessary_operation.rs:66 :5
77
+ --> $DIR/unnecessary_operation.rs:82 :5
78
78
|
79
79
LL | [42, get_number()];
80
80
| ^^^^^^^^^^^^^^^^^^^ help: statement can be reduced to: `42;get_number();`
81
81
82
82
error: unnecessary operation
83
- --> $DIR/unnecessary_operation.rs:67 :5
83
+ --> $DIR/unnecessary_operation.rs:83 :5
84
84
|
85
85
LL | [42, 55][get_usize()];
86
86
| ^^^^^^^^^^^^^^^^^^^^^^ help: statement can be written as: `assert!([42, 55].len() > get_usize());`
87
87
88
88
error: unnecessary operation
89
- --> $DIR/unnecessary_operation.rs:68 :5
89
+ --> $DIR/unnecessary_operation.rs:84 :5
90
90
|
91
91
LL | (42, get_number()).1;
92
92
| ^^^^^^^^^^^^^^^^^^^^^ help: statement can be reduced to: `42;get_number();`
93
93
94
94
error: unnecessary operation
95
- --> $DIR/unnecessary_operation.rs:69 :5
95
+ --> $DIR/unnecessary_operation.rs:85 :5
96
96
|
97
97
LL | [get_number(); 55];
98
98
| ^^^^^^^^^^^^^^^^^^^ help: statement can be reduced to: `get_number();`
99
99
100
100
error: unnecessary operation
101
- --> $DIR/unnecessary_operation.rs:70 :5
101
+ --> $DIR/unnecessary_operation.rs:86 :5
102
102
|
103
103
LL | [42; 55][get_usize()];
104
104
| ^^^^^^^^^^^^^^^^^^^^^^ help: statement can be written as: `assert!([42; 55].len() > get_usize());`
105
105
106
106
error: unnecessary operation
107
- --> $DIR/unnecessary_operation.rs:71 :5
107
+ --> $DIR/unnecessary_operation.rs:87 :5
108
108
|
109
109
LL | / {
110
110
LL | | get_number()
111
111
LL | | };
112
112
| |______^ help: statement can be reduced to: `get_number();`
113
113
114
114
error: unnecessary operation
115
- --> $DIR/unnecessary_operation.rs:74 :5
115
+ --> $DIR/unnecessary_operation.rs:90 :5
116
116
|
117
117
LL | / FooString {
118
118
LL | | s: String::from("blah"),
0 commit comments