mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-27 15:11:30 +00:00
21 lines
407 B
Rust
21 lines
407 B
Rust
|
// run-rustfix
|
||
|
|
||
|
#![allow(unused)]
|
||
|
#![warn(clippy::match_as_ref)]
|
||
|
|
||
|
fn match_as_ref() {
|
||
|
let owned: Option<()> = None;
|
||
|
let borrowed: Option<&()> = match owned {
|
||
|
None => None,
|
||
|
Some(ref v) => Some(v),
|
||
|
};
|
||
|
|
||
|
let mut mut_owned: Option<()> = None;
|
||
|
let borrow_mut: Option<&mut ()> = match mut_owned {
|
||
|
None => None,
|
||
|
Some(ref mut v) => Some(v),
|
||
|
};
|
||
|
}
|
||
|
|
||
|
fn main() {}
|