11error: 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
33 |
44LL | fn opt_u8(a: &Option<u8>) {}
55 | ^^^^^^^^^^^^^-----------^^^^
@@ -10,23 +10,23 @@ LL | fn opt_u8(a: &Option<u8>) {}
1010 = help: to override `-D warnings` add `#[allow(clippy::ref_option)]`
1111
1212error: 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
1414 |
1515LL | fn opt_gen<T>(a: &Option<T>) {}
1616 | ^^^^^^^^^^^^^^^^^----------^^^^
1717 | |
1818 | help: change this to: `Option<&T>`
1919
2020error: 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
2222 |
2323LL | fn opt_string(a: &std::option::Option<String>) {}
2424 | ^^^^^^^^^^^^^^^^^----------------------------^^^^
2525 | |
2626 | help: change this to: `std::option::Option<&String>`
2727
2828error: 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
3030 |
3131LL | fn ret_u8<'a>(p: &'a str) -> &'a Option<u8> {
3232 | ^ -------------- help: change this to: `Option<&'a u8>`
@@ -38,7 +38,7 @@ LL | | }
3838 | |_^
3939
4040error: 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
4242 |
4343LL | fn ret_u8_static() -> &'static Option<u8> {
4444 | ^ ------------------- help: change this to: `Option<&'static u8>`
@@ -50,7 +50,7 @@ LL | | }
5050 | |_^
5151
5252error: 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
5454 |
5555LL | fn mult_string(a: &Option<String>, b: &Option<Vec<u8>>) {}
5656 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -62,7 +62,7 @@ LL + fn mult_string(a: Option<&String>, b: Option<&Vec<u8>>) {}
6262 |
6363
6464error: 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
6666 |
6767LL | fn ret_box<'a>() -> &'a Option<Box<u8>> {
6868 | ^ ------------------- help: change this to: `Option<&'a Box<u8>>`
@@ -74,15 +74,15 @@ LL | | }
7474 | |_^
7575
7676error: 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
7878 |
7979LL | pub fn pub_opt_string(a: &Option<String>) {}
8080 | ^^^^^^^^^^^^^^^^^^^^^^^^^---------------^^^^
8181 | |
8282 | help: change this to: `Option<&String>`
8383
8484error: 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
8686 |
8787LL | pub fn pub_mult_string(a: &Option<String>, b: &Option<Vec<u8>>) {}
8888 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -94,15 +94,15 @@ LL + pub fn pub_mult_string(a: Option<&String>, b: Option<&Vec<u8>>) {}
9494 |
9595
9696error: 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
9898 |
9999LL | pub fn pub_opt_params(&self, a: &Option<()>) {}
100100 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-----------^^^^
101101 | |
102102 | help: change this to: `Option<&()>`
103103
104104error: 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
106106 |
107107LL | pub fn pub_opt_ret(&self) -> &Option<String> {
108108 | ^ --------------- help: change this to: `Option<&String>`
@@ -114,15 +114,15 @@ LL | | }
114114 | |_____^
115115
116116error: 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
118118 |
119119LL | fn private_opt_params(&self, a: &Option<()>) {}
120120 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-----------^^^^
121121 | |
122122 | help: change this to: `Option<&()>`
123123
124124error: 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
126126 |
127127LL | fn private_opt_ret(&self) -> &Option<String> {
128128 | ^ --------------- help: change this to: `Option<&String>`
0 commit comments