summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/tests/ui/needless_option_take.fixed
blob: bfc6d20d5a32602ce46400e8d65f8119c7774769 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
//@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();
}