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