262b35ea2c
This lint checks if Option::take() is used on a temporary value (a value that is not of type &mut Option and that is not a Place expression) to suggest omitting take()
6 lines
116 B
Rust
6 lines
116 B
Rust
fn main() {
|
|
println!("Testing option_take_on_temporary");
|
|
let x = Some(3);
|
|
let y = x.as_ref().take();
|
|
}
|