]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/tests/ui/get_unwrap.stderr
Rollup merge of #78216 - workingjubilee:duration-zero, r=m-ou-se
[rust.git] / src / tools / clippy / tests / ui / get_unwrap.stderr
1 error: called `.get().unwrap()` on a slice. Using `[]` is more clear and more concise
2   --> $DIR/get_unwrap.rs:34:17
3    |
4 LL |         let _ = boxed_slice.get(1).unwrap();
5    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&boxed_slice[1]`
6    |
7 note: the lint level is defined here
8   --> $DIR/get_unwrap.rs:3:9
9    |
10 LL | #![deny(clippy::get_unwrap)]
11    |         ^^^^^^^^^^^^^^^^^^
12
13 error: called `.get().unwrap()` on a slice. Using `[]` is more clear and more concise
14   --> $DIR/get_unwrap.rs:35:17
15    |
16 LL |         let _ = some_slice.get(0).unwrap();
17    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&some_slice[0]`
18
19 error: called `.get().unwrap()` on a Vec. Using `[]` is more clear and more concise
20   --> $DIR/get_unwrap.rs:36:17
21    |
22 LL |         let _ = some_vec.get(0).unwrap();
23    |                 ^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&some_vec[0]`
24
25 error: called `.get().unwrap()` on a VecDeque. Using `[]` is more clear and more concise
26   --> $DIR/get_unwrap.rs:37:17
27    |
28 LL |         let _ = some_vecdeque.get(0).unwrap();
29    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&some_vecdeque[0]`
30
31 error: called `.get().unwrap()` on a HashMap. Using `[]` is more clear and more concise
32   --> $DIR/get_unwrap.rs:38:17
33    |
34 LL |         let _ = some_hashmap.get(&1).unwrap();
35    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&some_hashmap[&1]`
36
37 error: called `.get().unwrap()` on a BTreeMap. Using `[]` is more clear and more concise
38   --> $DIR/get_unwrap.rs:39:17
39    |
40 LL |         let _ = some_btreemap.get(&1).unwrap();
41    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&some_btreemap[&1]`
42
43 error: called `.get().unwrap()` on a slice. Using `[]` is more clear and more concise
44   --> $DIR/get_unwrap.rs:42:21
45    |
46 LL |         let _: u8 = *boxed_slice.get(1).unwrap();
47    |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `boxed_slice[1]`
48
49 error: called `.get_mut().unwrap()` on a slice. Using `[]` is more clear and more concise
50   --> $DIR/get_unwrap.rs:47:9
51    |
52 LL |         *boxed_slice.get_mut(0).unwrap() = 1;
53    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `boxed_slice[0]`
54
55 error: called `.get_mut().unwrap()` on a slice. Using `[]` is more clear and more concise
56   --> $DIR/get_unwrap.rs:48:9
57    |
58 LL |         *some_slice.get_mut(0).unwrap() = 1;
59    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `some_slice[0]`
60
61 error: called `.get_mut().unwrap()` on a Vec. Using `[]` is more clear and more concise
62   --> $DIR/get_unwrap.rs:49:9
63    |
64 LL |         *some_vec.get_mut(0).unwrap() = 1;
65    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `some_vec[0]`
66
67 error: called `.get_mut().unwrap()` on a VecDeque. Using `[]` is more clear and more concise
68   --> $DIR/get_unwrap.rs:50:9
69    |
70 LL |         *some_vecdeque.get_mut(0).unwrap() = 1;
71    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `some_vecdeque[0]`
72
73 error: called `.get().unwrap()` on a Vec. Using `[]` is more clear and more concise
74   --> $DIR/get_unwrap.rs:59:17
75    |
76 LL |         let _ = some_vec.get(0..1).unwrap().to_vec();
77    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `some_vec[0..1]`
78
79 error: called `.get_mut().unwrap()` on a Vec. Using `[]` is more clear and more concise
80   --> $DIR/get_unwrap.rs:60:17
81    |
82 LL |         let _ = some_vec.get_mut(0..1).unwrap().to_vec();
83    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `some_vec[0..1]`
84
85 error: aborting due to 13 previous errors
86