rust-clippy/tests/ui/needless_option_take.stderr
infrandomness 262b35ea2c Introduce option_take_on_temporary lints
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()
2022-04-14 12:41:47 +02:00

10 lines
291 B
Text

error: called `Option::take()` on a temporary value
--> $DIR/needless_option_take.rs:14:5
|
LL | x.as_ref().take();
| ^^^^^^^^^^^^^^^^^ help: try: `x.as_ref()`
|
= note: `-D clippy::needless-option-take` implied by `-D warnings`
error: aborting due to previous error