rust/tests/ui/mem_replace.rs
Jay Kickliter 598df08d88 Add lint for mem::replace(.., None).
Suggest `Option::take()` as an alternative.
2018-09-19 14:38:34 -07:00

10 lines
210 B
Rust

#![feature(tool_lints)]
#![warn(clippy::all, clippy::style, clippy::mem_replace_option_with_none)]
use std::mem;
fn main() {
let mut an_option = Some(1);
let _ = mem::replace(&mut an_option, None);
}