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: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: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 11 previous errors