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