summary refs log tree commit diff
path: root/src/tools/clippy/tests/ui/get_unwrap.stderr
blob: 76a098df82aa199adb0186eb098b0e540fc6ba91 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
error: called `.get().unwrap()` on a slice. Using `[]` is more clear and more concise
  --> $DIR/get_unwrap.rs:34:17
   |
LL |         let _ = boxed_slice.get(1).unwrap();
   |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&boxed_slice[1]`
   |
note: the lint level is defined here
  --> $DIR/get_unwrap.rs:3:9
   |
LL | #![deny(clippy::get_unwrap)]
   |         ^^^^^^^^^^^^^^^^^^

error: called `.get().unwrap()` on a slice. Using `[]` is more clear and more concise
  --> $DIR/get_unwrap.rs:35:17
   |
LL |         let _ = some_slice.get(0).unwrap();
   |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&some_slice[0]`

error: called `.get().unwrap()` on a Vec. Using `[]` is more clear and more concise
  --> $DIR/get_unwrap.rs:36:17
   |
LL |         let _ = some_vec.get(0).unwrap();
   |                 ^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&some_vec[0]`

error: called `.get().unwrap()` on a VecDeque. Using `[]` is more clear and more concise
  --> $DIR/get_unwrap.rs:37:17
   |
LL |         let _ = some_vecdeque.get(0).unwrap();
   |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&some_vecdeque[0]`

error: called `.get().unwrap()` on a HashMap. Using `[]` is more clear and more concise
  --> $DIR/get_unwrap.rs:38:17
   |
LL |         let _ = some_hashmap.get(&1).unwrap();
   |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&some_hashmap[&1]`

error: called `.get().unwrap()` on a BTreeMap. Using `[]` is more clear and more concise
  --> $DIR/get_unwrap.rs:39:17
   |
LL |         let _ = some_btreemap.get(&1).unwrap();
   |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&some_btreemap[&1]`

error: called `.get().unwrap()` on a slice. Using `[]` is more clear and more concise
  --> $DIR/get_unwrap.rs:42:21
   |
LL |         let _: u8 = *boxed_slice.get(1).unwrap();
   |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `boxed_slice[1]`

error: called `.get_mut().unwrap()` on a slice. Using `[]` is more clear and more concise
  --> $DIR/get_unwrap.rs:47:9
   |
LL |         *boxed_slice.get_mut(0).unwrap() = 1;
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `boxed_slice[0]`

error: called `.get_mut().unwrap()` on a slice. Using `[]` is more clear and more concise
  --> $DIR/get_unwrap.rs:48:9
   |
LL |         *some_slice.get_mut(0).unwrap() = 1;
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `some_slice[0]`

error: called `.get_mut().unwrap()` on a Vec. Using `[]` is more clear and more concise
  --> $DIR/get_unwrap.rs:49:9
   |
LL |         *some_vec.get_mut(0).unwrap() = 1;
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `some_vec[0]`

error: called `.get_mut().unwrap()` on a VecDeque. Using `[]` is more clear and more concise
  --> $DIR/get_unwrap.rs:50:9
   |
LL |         *some_vecdeque.get_mut(0).unwrap() = 1;
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `some_vecdeque[0]`

error: called `.get().unwrap()` on a Vec. Using `[]` is more clear and more concise
  --> $DIR/get_unwrap.rs:59:17
   |
LL |         let _ = some_vec.get(0..1).unwrap().to_vec();
   |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `some_vec[0..1]`

error: called `.get_mut().unwrap()` on a Vec. Using `[]` is more clear and more concise
  --> $DIR/get_unwrap.rs:60:17
   |
LL |         let _ = some_vec.get_mut(0..1).unwrap().to_vec();
   |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `some_vec[0..1]`

error: aborting due to 13 previous errors