blob: a63efd60a0368ab8a261172f4071b9d2d7de894b (
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
87
88
89
90
91
92
93
94
95
96
97
|
error: it is more idiomatic to use `Option<&T>` instead of `&Option<T>`
--> tests/ui-toml/ref_option/ref_option.rs:9:1
|
LL | fn opt_u8(a: &Option<u8>) {}
| ^^^^^^^^^^^^^-----------^^^^
| |
| help: change this to: `Option<&u8>`
|
= note: `-D clippy::ref-option` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::ref_option)]`
error: it is more idiomatic to use `Option<&T>` instead of `&Option<T>`
--> tests/ui-toml/ref_option/ref_option.rs:11:1
|
LL | fn opt_gen<T>(a: &Option<T>) {}
| ^^^^^^^^^^^^^^^^^----------^^^^
| |
| help: change this to: `Option<&T>`
error: it is more idiomatic to use `Option<&T>` instead of `&Option<T>`
--> tests/ui-toml/ref_option/ref_option.rs:13:1
|
LL | fn opt_string(a: &std::option::Option<String>) {}
| ^^^^^^^^^^^^^^^^^----------------------------^^^^
| |
| help: change this to: `std::option::Option<&String>`
error: it is more idiomatic to use `Option<&T>` instead of `&Option<T>`
--> tests/ui-toml/ref_option/ref_option.rs:15:1
|
LL | fn ret_u8<'a>(p: &'a str) -> &'a Option<u8> {
| ^ -------------- help: change this to: `Option<&'a u8>`
| _|
| |
LL | |
LL | | panic!()
LL | | }
| |_^
error: it is more idiomatic to use `Option<&T>` instead of `&Option<T>`
--> tests/ui-toml/ref_option/ref_option.rs:19:1
|
LL | fn ret_u8_static() -> &'static Option<u8> {
| ^ ------------------- help: change this to: `Option<&'static u8>`
| _|
| |
LL | |
LL | | panic!()
LL | | }
| |_^
error: it is more idiomatic to use `Option<&T>` instead of `&Option<T>`
--> tests/ui-toml/ref_option/ref_option.rs:23:1
|
LL | fn mult_string(a: &Option<String>, b: &Option<Vec<u8>>) {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
help: change this to
|
LL - fn mult_string(a: &Option<String>, b: &Option<Vec<u8>>) {}
LL + fn mult_string(a: Option<&String>, b: Option<&Vec<u8>>) {}
|
error: it is more idiomatic to use `Option<&T>` instead of `&Option<T>`
--> tests/ui-toml/ref_option/ref_option.rs:25:1
|
LL | fn ret_box<'a>() -> &'a Option<Box<u8>> {
| ^ ------------------- help: change this to: `Option<&'a Box<u8>>`
| _|
| |
LL | |
LL | | panic!()
LL | | }
| |_^
error: it is more idiomatic to use `Option<&T>` instead of `&Option<T>`
--> tests/ui-toml/ref_option/ref_option.rs:45:5
|
LL | fn private_opt_params(&self, a: &Option<()>) {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-----------^^^^
| |
| help: change this to: `Option<&()>`
error: it is more idiomatic to use `Option<&T>` instead of `&Option<T>`
--> tests/ui-toml/ref_option/ref_option.rs:47:5
|
LL | fn private_opt_ret(&self) -> &Option<String> {
| ^ --------------- help: change this to: `Option<&String>`
| _____|
| |
LL | |
LL | | panic!()
LL | | }
| |_____^
error: aborting due to 9 previous errors
|