]> git.lizzy.rs Git - rust.git/blob - tests/ui/needless_option_take.fixed
Auto merge of #9684 - kraktus:ref_option_ref, r=xFrednet
[rust.git] / tests / ui / needless_option_take.fixed
1 // run-rustfix
2
3 fn main() {
4     println!("Testing non erroneous option_take_on_temporary");
5     let mut option = Some(1);
6     let _ = Box::new(move || option.take().unwrap());
7
8     println!("Testing non erroneous option_take_on_temporary");
9     let x = Some(3);
10     x.as_ref();
11
12     println!("Testing erroneous option_take_on_temporary");
13     let x = Some(3);
14     x.as_ref();
15 }