2 #![allow(unused_imports)]
6 clippy::mem_replace_option_with_none,
7 clippy::mem_replace_with_default
12 fn replace_option_with_none() {
13 let mut an_option = Some(1);
14 let _ = an_option.take();
15 let an_option = &mut Some(1);
16 let _ = an_option.take();
19 fn replace_with_default() {
20 let mut s = String::from("foo");
21 let _ = std::mem::take(&mut s);
22 let s = &mut String::from("foo");
23 let _ = std::mem::take(s);
24 let _ = std::mem::take(s);
28 replace_option_with_none();
29 replace_with_default();