rust-clippy/tests/ui/match_as_ref.fixed
Philipp Hansch 9a6c82094f
Add run-rustfix for match_as_ref lint
* Extracts `match_as_ref` into separate file
* Adds `// run-rustfix` to `tests/ui/match_as_ref.rs`
2019-04-19 12:08:34 +02:00

14 lines
285 B
Rust

// run-rustfix
#![allow(unused)]
#![warn(clippy::match_as_ref)]
fn match_as_ref() {
let owned: Option<()> = None;
let borrowed: Option<&()> = owned.as_ref();
let mut mut_owned: Option<()> = None;
let borrow_mut: Option<&mut ()> = mut_owned.as_mut();
}
fn main() {}