Skip to content

Commit 6a4236d

Browse files
committed
bless
1 parent 8960079 commit 6a4236d

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

tests/ui/unnecessary_operation.fixed

+1-1
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ fn main() {
114114
break 'label
115115
};
116116
let () = const {
117-
[42, 55][get_usize()];
117+
assert!([42, 55].len() > get_usize());
118118
};
119119
}
120120

tests/ui/unnecessary_operation.stderr

+7-1
Original file line numberDiff line numberDiff line change
@@ -119,11 +119,17 @@ LL | | s: String::from("blah"),
119119
LL | | };
120120
| |______^ help: statement can be reduced to: `String::from("blah");`
121121

122+
error: unnecessary operation
123+
--> tests/ui/unnecessary_operation.rs:121:9
124+
|
125+
LL | [42, 55][get_usize()];
126+
| ^^^^^^^^^^^^^^^^^^^^^^ help: statement can be written as: `assert!([42, 55].len() > get_usize());`
127+
122128
error: unnecessary operation
123129
--> tests/ui/unnecessary_operation.rs:130:5
124130
|
125131
LL | [42, 55][get_usize()];
126132
| ^^^^^^^^^^^^^^^^^^^^^^ help: statement can be written as: `assert!([42, 55].len() > get_usize());`
127133

128-
error: aborting due to 20 previous errors
134+
error: aborting due to 21 previous errors
129135

0 commit comments

Comments
 (0)