about summary refs log tree commit diff
path: root/src/tools/clippy/tests/ui/manual_option_as_slice.stderr
blob: e240ae8eb7d902210cd49090921f90fe3b6bc865 (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
error: use `Option::as_slice`
  --> tests/ui/manual_option_as_slice.rs:5:9
   |
LL |       _ = match x.as_ref() {
   |  _________^
LL | |
LL | |         Some(f) => std::slice::from_ref(f),
LL | |         None => &[],
LL | |     };
   | |_____^ help: use: `x.as_slice()`
   |
   = note: `-D clippy::manual-option-as-slice` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(clippy::manual_option_as_slice)]`

error: use `Option::as_slice`
  --> tests/ui/manual_option_as_slice.rs:11:9
   |
LL |       _ = if let Some(f) = x.as_ref() {
   |  _________^
LL | |
LL | |
LL | |         std::slice::from_ref(f)
LL | |     } else {
LL | |         &[]
LL | |     };
   | |_____^ help: use: `x.as_slice()`

error: use `Option::as_slice`
  --> tests/ui/manual_option_as_slice.rs:19:9
   |
LL |     _ = x.as_ref().map_or(&[][..], std::slice::from_ref);
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `x.as_slice()`

error: use `Option::as_slice`
  --> tests/ui/manual_option_as_slice.rs:22:9
   |
LL |     _ = x.as_ref().map_or_else(Default::default, std::slice::from_ref);
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `x.as_slice()`

error: use `Option::as_slice`
  --> tests/ui/manual_option_as_slice.rs:25:9
   |
LL |     _ = x.as_ref().map(std::slice::from_ref).unwrap_or_default();
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `x.as_slice()`

error: use `Option::as_slice`
  --> tests/ui/manual_option_as_slice.rs:28:9
   |
LL |     _ = x.as_ref().map_or_else(|| &[42][..0], std::slice::from_ref);
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `x.as_slice()`

error: use `Option::as_slice`
  --> tests/ui/manual_option_as_slice.rs:33:13
   |
LL |         _ = x.as_ref().map_or_else(<&[_]>::default, from_ref);
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `x.as_slice()`

error: aborting due to 7 previous errors