error: it is more idiomatic to use `Option<&T>` instead of `&Option` --> tests/ui/ref_option/ref_option.rs:8:1 | LL | fn opt_u8(a: &Option) {} | ^^^^^^^^^^^^^-----------^^^^ | | | 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` --> tests/ui/ref_option/ref_option.rs:9:1 | LL | fn opt_gen(a: &Option) {} | ^^^^^^^^^^^^^^^^^----------^^^^ | | | help: change this to: `Option<&T>` error: it is more idiomatic to use `Option<&T>` instead of `&Option` --> tests/ui/ref_option/ref_option.rs:10:1 | LL | fn opt_string(a: &std::option::Option) {} | ^^^^^^^^^^^^^^^^^----------------------------^^^^ | | | help: change this to: `std::option::Option<&String>` error: it is more idiomatic to use `Option<&T>` instead of `&Option` --> tests/ui/ref_option/ref_option.rs:11:1 | LL | fn ret_string<'a>(p: &'a str) -> &'a Option { | ^ -------------- help: change this to: `Option<&'a u8>` | _| | | LL | | panic!() LL | | } | |_^ error: it is more idiomatic to use `Option<&T>` instead of `&Option` --> tests/ui/ref_option/ref_option.rs:14:1 | LL | fn ret_string_static() -> &'static Option { | ^ ------------------- help: change this to: `Option<&'static u8>` | _| | | LL | | panic!() LL | | } | |_^ error: it is more idiomatic to use `Option<&T>` instead of `&Option` --> tests/ui/ref_option/ref_option.rs:17:1 | LL | fn mult_string(a: &Option, b: &Option>) {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | help: change this to | LL | fn mult_string(a: Option<&String>, b: Option<&Vec>) {} | ~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~ error: it is more idiomatic to use `Option<&T>` instead of `&Option` --> tests/ui/ref_option/ref_option.rs:18:1 | LL | fn ret_box<'a>() -> &'a Option> { | ^ ------------------- help: change this to: `Option<&'a Box>` | _| | | LL | | panic!() LL | | } | |_^ error: it is more idiomatic to use `Option<&T>` instead of `&Option` --> tests/ui/ref_option/ref_option.rs:22:1 | LL | pub fn pub_opt_string(a: &Option) {} | ^^^^^^^^^^^^^^^^^^^^^^^^^---------------^^^^ | | | help: change this to: `Option<&String>` error: it is more idiomatic to use `Option<&T>` instead of `&Option` --> tests/ui/ref_option/ref_option.rs:23:1 | LL | pub fn pub_mult_string(a: &Option, b: &Option>) {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | help: change this to | LL | pub fn pub_mult_string(a: Option<&String>, b: Option<&Vec>) {} | ~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~ error: it is more idiomatic to use `Option<&T>` instead of `&Option` --> tests/ui/ref_option/ref_option.rs:26:5 | LL | fn pub_trait_opt(&self, a: &Option>); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^----------------^^ | | | help: change this to: `Option<&Vec>` error: it is more idiomatic to use `Option<&T>` instead of `&Option` --> tests/ui/ref_option/ref_option.rs:27:5 | LL | fn pub_trait_ret(&self) -> &Option>; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^----------------^ | | | help: change this to: `Option<&Vec>` error: it is more idiomatic to use `Option<&T>` instead of `&Option` --> tests/ui/ref_option/ref_option.rs:31:5 | LL | fn trait_opt(&self, a: &Option); | ^^^^^^^^^^^^^^^^^^^^^^^---------------^^ | | | help: change this to: `Option<&String>` error: it is more idiomatic to use `Option<&T>` instead of `&Option` --> tests/ui/ref_option/ref_option.rs:32:5 | LL | fn trait_ret(&self) -> &Option; | ^^^^^^^^^^^^^^^^^^^^^^^---------------^ | | | help: change this to: `Option<&String>` error: it is more idiomatic to use `Option<&T>` instead of `&Option` --> tests/ui/ref_option/ref_option.rs:38:5 | LL | pub fn pub_opt_params(&self, a: &Option<()>) {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-----------^^^^ | | | help: change this to: `Option<&()>` error: it is more idiomatic to use `Option<&T>` instead of `&Option` --> tests/ui/ref_option/ref_option.rs:39:5 | LL | pub fn pub_opt_ret(&self) -> &Option { | ^ --------------- help: change this to: `Option<&String>` | _____| | | LL | | panic!() LL | | } | |_____^ error: it is more idiomatic to use `Option<&T>` instead of `&Option` --> tests/ui/ref_option/ref_option.rs:43: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` --> tests/ui/ref_option/ref_option.rs:44:5 | LL | fn private_opt_ret(&self) -> &Option { | ^ --------------- help: change this to: `Option<&String>` | _____| | | LL | | panic!() LL | | } | |_____^ error: aborting due to 17 previous errors