1
- error: use `Option::as_slice`
1
+ error: manual implementation of `Option::as_slice`
2
2
--> tests/ui/manual_option_as_slice.rs:5:9
3
3
|
4
4
LL | _ = match x.as_ref() {
@@ -12,7 +12,7 @@ LL | | };
12
12
= note: `-D clippy::manual-option-as-slice` implied by `-D warnings`
13
13
= help: to override `-D warnings` add `#[allow(clippy::manual_option_as_slice)]`
14
14
15
- error: use `Option::as_slice`
15
+ error: manual implementation of `Option::as_slice`
16
16
--> tests/ui/manual_option_as_slice.rs:11:9
17
17
|
18
18
LL | _ = if let Some(f) = x.as_ref() {
@@ -25,31 +25,31 @@ LL | | &[]
25
25
LL | | };
26
26
| |_____^ help: use: `x.as_slice()`
27
27
28
- error: use `Option::as_slice`
28
+ error: manual implementation of `Option::as_slice`
29
29
--> tests/ui/manual_option_as_slice.rs:19:9
30
30
|
31
31
LL | _ = x.as_ref().map_or(&[][..], std::slice::from_ref);
32
32
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `x.as_slice()`
33
33
34
- error: use `Option::as_slice`
34
+ error: manual implementation of `Option::as_slice`
35
35
--> tests/ui/manual_option_as_slice.rs:22:9
36
36
|
37
37
LL | _ = x.as_ref().map_or_else(Default::default, std::slice::from_ref);
38
38
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `x.as_slice()`
39
39
40
- error: use `Option::as_slice`
40
+ error: manual implementation of `Option::as_slice`
41
41
--> tests/ui/manual_option_as_slice.rs:25:9
42
42
|
43
43
LL | _ = x.as_ref().map(std::slice::from_ref).unwrap_or_default();
44
44
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `x.as_slice()`
45
45
46
- error: use `Option::as_slice`
46
+ error: manual implementation of `Option::as_slice`
47
47
--> tests/ui/manual_option_as_slice.rs:28:9
48
48
|
49
49
LL | _ = x.as_ref().map_or_else(|| &[42][..0], std::slice::from_ref);
50
50
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `x.as_slice()`
51
51
52
- error: use `Option::as_slice`
52
+ error: manual implementation of `Option::as_slice`
53
53
--> tests/ui/manual_option_as_slice.rs:33:13
54
54
|
55
55
LL | _ = x.as_ref().map_or_else(<&[_]>::default, from_ref);
0 commit comments