@@ -7,80 +7,221 @@ LL | let _ = boxed_slice.get(1).unwrap();
77note: the lint level is defined here
88 --> $DIR/get_unwrap.rs:3:9
99 |
10- LL | #![deny(clippy::get_unwrap)]
10+ LL | #![deny(clippy::get_unwrap, clippy::unwrap_used )]
1111 | ^^^^^^^^^^^^^^^^^^
1212
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+
1326error: called `.get().unwrap()` on a slice. Using `[]` is more clear and more concise
1427 --> $DIR/get_unwrap.rs:35:17
1528 |
1629LL | let _ = some_slice.get(0).unwrap();
1730 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&some_slice[0]`
1831
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+
1940error: called `.get().unwrap()` on a Vec. Using `[]` is more clear and more concise
2041 --> $DIR/get_unwrap.rs:36:17
2142 |
2243LL | let _ = some_vec.get(0).unwrap();
2344 | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&some_vec[0]`
2445
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+
2554error: called `.get().unwrap()` on a VecDeque. Using `[]` is more clear and more concise
2655 --> $DIR/get_unwrap.rs:37:17
2756 |
2857LL | let _ = some_vecdeque.get(0).unwrap();
2958 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&some_vecdeque[0]`
3059
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+
3168error: called `.get().unwrap()` on a HashMap. Using `[]` is more clear and more concise
3269 --> $DIR/get_unwrap.rs:38:17
3370 |
3471LL | let _ = some_hashmap.get(&1).unwrap();
3572 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&some_hashmap[&1]`
3673
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+
3782error: called `.get().unwrap()` on a BTreeMap. Using `[]` is more clear and more concise
3883 --> $DIR/get_unwrap.rs:39:17
3984 |
4085LL | let _ = some_btreemap.get(&1).unwrap();
4186 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&some_btreemap[&1]`
4287
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+
43104error: called `.get().unwrap()` on a slice. Using `[]` is more clear and more concise
44105 --> $DIR/get_unwrap.rs:42:21
45106 |
46107LL | let _: u8 = *boxed_slice.get(1).unwrap();
47108 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `boxed_slice[1]`
48109
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+
49118error: called `.get_mut().unwrap()` on a slice. Using `[]` is more clear and more concise
50119 --> $DIR/get_unwrap.rs:47:9
51120 |
52121LL | *boxed_slice.get_mut(0).unwrap() = 1;
53122 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `boxed_slice[0]`
54123
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+
55132error: called `.get_mut().unwrap()` on a slice. Using `[]` is more clear and more concise
56133 --> $DIR/get_unwrap.rs:48:9
57134 |
58135LL | *some_slice.get_mut(0).unwrap() = 1;
59136 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `some_slice[0]`
60137
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+
61146error: called `.get_mut().unwrap()` on a Vec. Using `[]` is more clear and more concise
62147 --> $DIR/get_unwrap.rs:49:9
63148 |
64149LL | *some_vec.get_mut(0).unwrap() = 1;
65150 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `some_vec[0]`
66151
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+
67160error: called `.get_mut().unwrap()` on a VecDeque. Using `[]` is more clear and more concise
68161 --> $DIR/get_unwrap.rs:50:9
69162 |
70163LL | *some_vecdeque.get_mut(0).unwrap() = 1;
71164 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `some_vecdeque[0]`
72165
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+
73198error: called `.get().unwrap()` on a Vec. Using `[]` is more clear and more concise
74199 --> $DIR/get_unwrap.rs:59:17
75200 |
76201LL | let _ = some_vec.get(0..1).unwrap().to_vec();
77202 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `some_vec[0..1]`
78203
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+
79212error: called `.get_mut().unwrap()` on a Vec. Using `[]` is more clear and more concise
80213 --> $DIR/get_unwrap.rs:60:17
81214 |
82215LL | let _ = some_vec.get_mut(0..1).unwrap().to_vec();
83216 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `some_vec[0..1]`
84217
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
86227
0 commit comments