@@ -7,80 +7,221 @@ LL | let _ = boxed_slice.get(1).unwrap();
7
7
note: the lint level is defined here
8
8
--> $DIR/get_unwrap.rs:3:9
9
9
|
10
- LL | #![deny(clippy::get_unwrap)]
10
+ LL | #![deny(clippy::get_unwrap, clippy::unwrap_used )]
11
11
| ^^^^^^^^^^^^^^^^^^
12
12
13
+ error: used `unwrap()` on `an Option` value
14
+ --> $DIR/get_unwrap.rs:34:17
15
+ |
16
+ LL | let _ = boxed_slice.get(1).unwrap();
17
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
18
+ |
19
+ note: the lint level is defined here
20
+ --> $DIR/get_unwrap.rs:3:29
21
+ |
22
+ LL | #![deny(clippy::get_unwrap, clippy::unwrap_used)]
23
+ | ^^^^^^^^^^^^^^^^^^^
24
+ = help: if you don't want to handle the `None` case gracefully, consider using `expect()` to provide a better panic message
25
+
13
26
error: called `.get().unwrap()` on a slice. Using `[]` is more clear and more concise
14
27
--> $DIR/get_unwrap.rs:35:17
15
28
|
16
29
LL | let _ = some_slice.get(0).unwrap();
17
30
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&some_slice[0]`
18
31
32
+ error: used `unwrap()` on `an Option` value
33
+ --> $DIR/get_unwrap.rs:35:17
34
+ |
35
+ LL | let _ = some_slice.get(0).unwrap();
36
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^
37
+ |
38
+ = help: if you don't want to handle the `None` case gracefully, consider using `expect()` to provide a better panic message
39
+
19
40
error: called `.get().unwrap()` on a Vec. Using `[]` is more clear and more concise
20
41
--> $DIR/get_unwrap.rs:36:17
21
42
|
22
43
LL | let _ = some_vec.get(0).unwrap();
23
44
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&some_vec[0]`
24
45
46
+ error: used `unwrap()` on `an Option` value
47
+ --> $DIR/get_unwrap.rs:36:17
48
+ |
49
+ LL | let _ = some_vec.get(0).unwrap();
50
+ | ^^^^^^^^^^^^^^^^^^^^^^^^
51
+ |
52
+ = help: if you don't want to handle the `None` case gracefully, consider using `expect()` to provide a better panic message
53
+
25
54
error: called `.get().unwrap()` on a VecDeque. Using `[]` is more clear and more concise
26
55
--> $DIR/get_unwrap.rs:37:17
27
56
|
28
57
LL | let _ = some_vecdeque.get(0).unwrap();
29
58
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&some_vecdeque[0]`
30
59
60
+ error: used `unwrap()` on `an Option` value
61
+ --> $DIR/get_unwrap.rs:37:17
62
+ |
63
+ LL | let _ = some_vecdeque.get(0).unwrap();
64
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
65
+ |
66
+ = help: if you don't want to handle the `None` case gracefully, consider using `expect()` to provide a better panic message
67
+
31
68
error: called `.get().unwrap()` on a HashMap. Using `[]` is more clear and more concise
32
69
--> $DIR/get_unwrap.rs:38:17
33
70
|
34
71
LL | let _ = some_hashmap.get(&1).unwrap();
35
72
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&some_hashmap[&1]`
36
73
74
+ error: used `unwrap()` on `an Option` value
75
+ --> $DIR/get_unwrap.rs:38:17
76
+ |
77
+ LL | let _ = some_hashmap.get(&1).unwrap();
78
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
79
+ |
80
+ = help: if you don't want to handle the `None` case gracefully, consider using `expect()` to provide a better panic message
81
+
37
82
error: called `.get().unwrap()` on a BTreeMap. Using `[]` is more clear and more concise
38
83
--> $DIR/get_unwrap.rs:39:17
39
84
|
40
85
LL | let _ = some_btreemap.get(&1).unwrap();
41
86
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&some_btreemap[&1]`
42
87
88
+ error: used `unwrap()` on `an Option` value
89
+ --> $DIR/get_unwrap.rs:39:17
90
+ |
91
+ LL | let _ = some_btreemap.get(&1).unwrap();
92
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
93
+ |
94
+ = help: if you don't want to handle the `None` case gracefully, consider using `expect()` to provide a better panic message
95
+
96
+ error: used `unwrap()` on `an Option` value
97
+ --> $DIR/get_unwrap.rs:40:17
98
+ |
99
+ LL | let _ = false_positive.get(0).unwrap();
100
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
101
+ |
102
+ = help: if you don't want to handle the `None` case gracefully, consider using `expect()` to provide a better panic message
103
+
43
104
error: called `.get().unwrap()` on a slice. Using `[]` is more clear and more concise
44
105
--> $DIR/get_unwrap.rs:42:21
45
106
|
46
107
LL | let _: u8 = *boxed_slice.get(1).unwrap();
47
108
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `boxed_slice[1]`
48
109
110
+ error: used `unwrap()` on `an Option` value
111
+ --> $DIR/get_unwrap.rs:42:22
112
+ |
113
+ LL | let _: u8 = *boxed_slice.get(1).unwrap();
114
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
115
+ |
116
+ = help: if you don't want to handle the `None` case gracefully, consider using `expect()` to provide a better panic message
117
+
49
118
error: called `.get_mut().unwrap()` on a slice. Using `[]` is more clear and more concise
50
119
--> $DIR/get_unwrap.rs:47:9
51
120
|
52
121
LL | *boxed_slice.get_mut(0).unwrap() = 1;
53
122
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `boxed_slice[0]`
54
123
124
+ error: used `unwrap()` on `an Option` value
125
+ --> $DIR/get_unwrap.rs:47:10
126
+ |
127
+ LL | *boxed_slice.get_mut(0).unwrap() = 1;
128
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
129
+ |
130
+ = help: if you don't want to handle the `None` case gracefully, consider using `expect()` to provide a better panic message
131
+
55
132
error: called `.get_mut().unwrap()` on a slice. Using `[]` is more clear and more concise
56
133
--> $DIR/get_unwrap.rs:48:9
57
134
|
58
135
LL | *some_slice.get_mut(0).unwrap() = 1;
59
136
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `some_slice[0]`
60
137
138
+ error: used `unwrap()` on `an Option` value
139
+ --> $DIR/get_unwrap.rs:48:10
140
+ |
141
+ LL | *some_slice.get_mut(0).unwrap() = 1;
142
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
143
+ |
144
+ = help: if you don't want to handle the `None` case gracefully, consider using `expect()` to provide a better panic message
145
+
61
146
error: called `.get_mut().unwrap()` on a Vec. Using `[]` is more clear and more concise
62
147
--> $DIR/get_unwrap.rs:49:9
63
148
|
64
149
LL | *some_vec.get_mut(0).unwrap() = 1;
65
150
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `some_vec[0]`
66
151
152
+ error: used `unwrap()` on `an Option` value
153
+ --> $DIR/get_unwrap.rs:49:10
154
+ |
155
+ LL | *some_vec.get_mut(0).unwrap() = 1;
156
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
157
+ |
158
+ = help: if you don't want to handle the `None` case gracefully, consider using `expect()` to provide a better panic message
159
+
67
160
error: called `.get_mut().unwrap()` on a VecDeque. Using `[]` is more clear and more concise
68
161
--> $DIR/get_unwrap.rs:50:9
69
162
|
70
163
LL | *some_vecdeque.get_mut(0).unwrap() = 1;
71
164
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `some_vecdeque[0]`
72
165
166
+ error: used `unwrap()` on `an Option` value
167
+ --> $DIR/get_unwrap.rs:50:10
168
+ |
169
+ LL | *some_vecdeque.get_mut(0).unwrap() = 1;
170
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
171
+ |
172
+ = help: if you don't want to handle the `None` case gracefully, consider using `expect()` to provide a better panic message
173
+
174
+ error: used `unwrap()` on `an Option` value
175
+ --> $DIR/get_unwrap.rs:52:10
176
+ |
177
+ LL | *some_hashmap.get_mut(&1).unwrap() = 'b';
178
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
179
+ |
180
+ = help: if you don't want to handle the `None` case gracefully, consider using `expect()` to provide a better panic message
181
+
182
+ error: used `unwrap()` on `an Option` value
183
+ --> $DIR/get_unwrap.rs:53:10
184
+ |
185
+ LL | *some_btreemap.get_mut(&1).unwrap() = 'b';
186
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
187
+ |
188
+ = help: if you don't want to handle the `None` case gracefully, consider using `expect()` to provide a better panic message
189
+
190
+ error: used `unwrap()` on `an Option` value
191
+ --> $DIR/get_unwrap.rs:54:10
192
+ |
193
+ LL | *false_positive.get_mut(0).unwrap() = 1;
194
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
195
+ |
196
+ = help: if you don't want to handle the `None` case gracefully, consider using `expect()` to provide a better panic message
197
+
73
198
error: called `.get().unwrap()` on a Vec. Using `[]` is more clear and more concise
74
199
--> $DIR/get_unwrap.rs:59:17
75
200
|
76
201
LL | let _ = some_vec.get(0..1).unwrap().to_vec();
77
202
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `some_vec[0..1]`
78
203
204
+ error: used `unwrap()` on `an Option` value
205
+ --> $DIR/get_unwrap.rs:59:17
206
+ |
207
+ LL | let _ = some_vec.get(0..1).unwrap().to_vec();
208
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
209
+ |
210
+ = help: if you don't want to handle the `None` case gracefully, consider using `expect()` to provide a better panic message
211
+
79
212
error: called `.get_mut().unwrap()` on a Vec. Using `[]` is more clear and more concise
80
213
--> $DIR/get_unwrap.rs:60:17
81
214
|
82
215
LL | let _ = some_vec.get_mut(0..1).unwrap().to_vec();
83
216
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `some_vec[0..1]`
84
217
85
- error: aborting due to 13 previous errors
218
+ error: used `unwrap()` on `an Option` value
219
+ --> $DIR/get_unwrap.rs:60:17
220
+ |
221
+ LL | let _ = some_vec.get_mut(0..1).unwrap().to_vec();
222
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
223
+ |
224
+ = help: if you don't want to handle the `None` case gracefully, consider using `expect()` to provide a better panic message
225
+
226
+ error: aborting due to 30 previous errors
86
227
0 commit comments