| error: replacing an `Option` with `Some(..)` | |
| --> tests/ui/mem_replace_option_with_some.rs:8:20 | |
| | | |
| LL | let replaced = mem::replace(&mut an_option, Some(1)); | |
| | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `Option::replace()` instead: `an_option.replace(1)` | |
| | | |
| = note: `-D clippy::mem-replace-option-with-some` implied by `-D warnings` | |
| = help: to override `-D warnings` add `#[allow(clippy::mem_replace_option_with_some)]` | |
| error: replacing an `Option` with `Some(..)` | |
| --> tests/ui/mem_replace_option_with_some.rs:12:20 | |
| | | |
| LL | let replaced = mem::replace(an_option, Some(1)); | |
| | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `Option::replace()` instead: `an_option.replace(1)` | |
| error: replacing an `Option` with `Some(..)` | |
| --> tests/ui/mem_replace_option_with_some.rs:17:20 | |
| | | |
| LL | let replaced = mem::replace(if b { &mut opt1 } else { &mut opt2 }, Some(1)); | |
| | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `Option::replace()` instead: `(if b { &mut opt1 } else { &mut opt2 }).replace(1)` | |
| error: aborting due to 3 previous errors | |