rust/tests/ui/ref_option/ref_option_traits.all.stderr
2024-09-28 11:57:34 -04:00

38 lines
1.5 KiB
Plaintext

error: it is more idiomatic to use `Option<&T>` instead of `&Option<T>`
--> tests/ui/ref_option/ref_option_traits.rs:10:5
|
LL | fn pub_trait_opt(&self, a: &Option<Vec<u8>>);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^----------------^^
| |
| help: change this to: `Option<&Vec<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/ref_option/ref_option_traits.rs:11:5
|
LL | fn pub_trait_ret(&self) -> &Option<Vec<u8>>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^----------------^
| |
| help: change this to: `Option<&Vec<u8>>`
error: it is more idiomatic to use `Option<&T>` instead of `&Option<T>`
--> tests/ui/ref_option/ref_option_traits.rs:15:5
|
LL | fn trait_opt(&self, a: &Option<String>);
| ^^^^^^^^^^^^^^^^^^^^^^^---------------^^
| |
| help: change this to: `Option<&String>`
error: it is more idiomatic to use `Option<&T>` instead of `&Option<T>`
--> tests/ui/ref_option/ref_option_traits.rs:16:5
|
LL | fn trait_ret(&self) -> &Option<String>;
| ^^^^^^^^^^^^^^^^^^^^^^^---------------^
| |
| help: change this to: `Option<&String>`
error: aborting due to 4 previous errors