1
1
error: it is more idiomatic to use `Option<&T>` instead of `&Option<T>`
2
- --> tests/ui-toml/ref_option/ref_option.rs:8 :1
2
+ --> tests/ui-toml/ref_option/ref_option.rs:9 :1
3
3
|
4
4
LL | fn opt_u8(a: &Option<u8>) {}
5
5
| ^^^^^^^^^^^^^-----------^^^^
@@ -10,23 +10,23 @@ LL | fn opt_u8(a: &Option<u8>) {}
10
10
= help: to override `-D warnings` add `#[allow(clippy::ref_option)]`
11
11
12
12
error: it is more idiomatic to use `Option<&T>` instead of `&Option<T>`
13
- --> tests/ui-toml/ref_option/ref_option.rs:10 :1
13
+ --> tests/ui-toml/ref_option/ref_option.rs:11 :1
14
14
|
15
15
LL | fn opt_gen<T>(a: &Option<T>) {}
16
16
| ^^^^^^^^^^^^^^^^^----------^^^^
17
17
| |
18
18
| help: change this to: `Option<&T>`
19
19
20
20
error: it is more idiomatic to use `Option<&T>` instead of `&Option<T>`
21
- --> tests/ui-toml/ref_option/ref_option.rs:12 :1
21
+ --> tests/ui-toml/ref_option/ref_option.rs:13 :1
22
22
|
23
23
LL | fn opt_string(a: &std::option::Option<String>) {}
24
24
| ^^^^^^^^^^^^^^^^^----------------------------^^^^
25
25
| |
26
26
| help: change this to: `std::option::Option<&String>`
27
27
28
28
error: it is more idiomatic to use `Option<&T>` instead of `&Option<T>`
29
- --> tests/ui-toml/ref_option/ref_option.rs:14 :1
29
+ --> tests/ui-toml/ref_option/ref_option.rs:15 :1
30
30
|
31
31
LL | fn ret_u8<'a>(p: &'a str) -> &'a Option<u8> {
32
32
| ^ -------------- help: change this to: `Option<&'a u8>`
@@ -38,7 +38,7 @@ LL | | }
38
38
| |_^
39
39
40
40
error: it is more idiomatic to use `Option<&T>` instead of `&Option<T>`
41
- --> tests/ui-toml/ref_option/ref_option.rs:18 :1
41
+ --> tests/ui-toml/ref_option/ref_option.rs:19 :1
42
42
|
43
43
LL | fn ret_u8_static() -> &'static Option<u8> {
44
44
| ^ ------------------- help: change this to: `Option<&'static u8>`
@@ -50,7 +50,7 @@ LL | | }
50
50
| |_^
51
51
52
52
error: it is more idiomatic to use `Option<&T>` instead of `&Option<T>`
53
- --> tests/ui-toml/ref_option/ref_option.rs:22 :1
53
+ --> tests/ui-toml/ref_option/ref_option.rs:23 :1
54
54
|
55
55
LL | fn mult_string(a: &Option<String>, b: &Option<Vec<u8>>) {}
56
56
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -62,7 +62,7 @@ LL + fn mult_string(a: Option<&String>, b: Option<&Vec<u8>>) {}
62
62
|
63
63
64
64
error: it is more idiomatic to use `Option<&T>` instead of `&Option<T>`
65
- --> tests/ui-toml/ref_option/ref_option.rs:24 :1
65
+ --> tests/ui-toml/ref_option/ref_option.rs:25 :1
66
66
|
67
67
LL | fn ret_box<'a>() -> &'a Option<Box<u8>> {
68
68
| ^ ------------------- help: change this to: `Option<&'a Box<u8>>`
@@ -74,15 +74,15 @@ LL | | }
74
74
| |_^
75
75
76
76
error: it is more idiomatic to use `Option<&T>` instead of `&Option<T>`
77
- --> tests/ui-toml/ref_option/ref_option.rs:29 :1
77
+ --> tests/ui-toml/ref_option/ref_option.rs:30 :1
78
78
|
79
79
LL | pub fn pub_opt_string(a: &Option<String>) {}
80
80
| ^^^^^^^^^^^^^^^^^^^^^^^^^---------------^^^^
81
81
| |
82
82
| help: change this to: `Option<&String>`
83
83
84
84
error: it is more idiomatic to use `Option<&T>` instead of `&Option<T>`
85
- --> tests/ui-toml/ref_option/ref_option.rs:31 :1
85
+ --> tests/ui-toml/ref_option/ref_option.rs:32 :1
86
86
|
87
87
LL | pub fn pub_mult_string(a: &Option<String>, b: &Option<Vec<u8>>) {}
88
88
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -94,15 +94,15 @@ LL + pub fn pub_mult_string(a: Option<&String>, b: Option<&Vec<u8>>) {}
94
94
|
95
95
96
96
error: it is more idiomatic to use `Option<&T>` instead of `&Option<T>`
97
- --> tests/ui-toml/ref_option/ref_option.rs:37 :5
97
+ --> tests/ui-toml/ref_option/ref_option.rs:38 :5
98
98
|
99
99
LL | pub fn pub_opt_params(&self, a: &Option<()>) {}
100
100
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-----------^^^^
101
101
| |
102
102
| help: change this to: `Option<&()>`
103
103
104
104
error: it is more idiomatic to use `Option<&T>` instead of `&Option<T>`
105
- --> tests/ui-toml/ref_option/ref_option.rs:39 :5
105
+ --> tests/ui-toml/ref_option/ref_option.rs:40 :5
106
106
|
107
107
LL | pub fn pub_opt_ret(&self) -> &Option<String> {
108
108
| ^ --------------- help: change this to: `Option<&String>`
@@ -114,15 +114,15 @@ LL | | }
114
114
| |_____^
115
115
116
116
error: it is more idiomatic to use `Option<&T>` instead of `&Option<T>`
117
- --> tests/ui-toml/ref_option/ref_option.rs:44 :5
117
+ --> tests/ui-toml/ref_option/ref_option.rs:45 :5
118
118
|
119
119
LL | fn private_opt_params(&self, a: &Option<()>) {}
120
120
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-----------^^^^
121
121
| |
122
122
| help: change this to: `Option<&()>`
123
123
124
124
error: it is more idiomatic to use `Option<&T>` instead of `&Option<T>`
125
- --> tests/ui-toml/ref_option/ref_option.rs:46 :5
125
+ --> tests/ui-toml/ref_option/ref_option.rs:47 :5
126
126
|
127
127
LL | fn private_opt_ret(&self) -> &Option<String> {
128
128
| ^ --------------- help: change this to: `Option<&String>`
0 commit comments