mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-12-18 09:03:18 +00:00
16 lines
385 B
Rust
16 lines
385 B
Rust
|
// run-rustfix
|
||
|
|
||
|
fn main() {
|
||
|
println!("Testing non erroneous option_take_on_temporary");
|
||
|
let mut option = Some(1);
|
||
|
let _ = Box::new(move || option.take().unwrap());
|
||
|
|
||
|
println!("Testing non erroneous option_take_on_temporary");
|
||
|
let x = Some(3);
|
||
|
x.as_ref();
|
||
|
|
||
|
println!("Testing erroneous option_take_on_temporary");
|
||
|
let x = Some(3);
|
||
|
x.as_ref().take();
|
||
|
}
|