2018-09-17 01:25:33 +02:00
|
|
|
error: replacing an `Option` with `None`
|
2020-02-20 12:06:06 +01:00
|
|
|
--> $DIR/mem_replace.rs:14:13
|
2018-10-06 18:18:06 +02:00
|
|
|
|
|
2018-12-27 16:57:55 +01:00
|
|
|
LL | let _ = mem::replace(&mut an_option, None);
|
2018-10-06 18:18:06 +02:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider `Option::take()` instead: `an_option.take()`
|
|
|
|
|
|
|
|
|
= note: `-D clippy::mem-replace-option-with-none` implied by `-D warnings`
|
2018-09-17 01:25:33 +02:00
|
|
|
|
2018-09-19 01:54:01 +02:00
|
|
|
error: replacing an `Option` with `None`
|
2020-02-20 12:06:06 +01:00
|
|
|
--> $DIR/mem_replace.rs:16:13
|
2018-09-19 01:54:01 +02:00
|
|
|
|
|
2018-12-27 16:57:55 +01:00
|
|
|
LL | let _ = mem::replace(an_option, None);
|
2018-09-19 01:54:01 +02:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider `Option::take()` instead: `an_option.take()`
|
|
|
|
|
2019-12-08 04:10:06 +01:00
|
|
|
error: replacing a value of type `T` with `T::default()` is better expressed using `std::mem::take`
|
2020-02-20 12:06:06 +01:00
|
|
|
--> $DIR/mem_replace.rs:21:13
|
2019-12-08 04:10:06 +01:00
|
|
|
|
|
|
|
|
LL | let _ = std::mem::replace(&mut s, String::default());
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `std::mem::take(&mut s)`
|
|
|
|
|
|
|
|
|
= note: `-D clippy::mem-replace-with-default` implied by `-D warnings`
|
|
|
|
|
|
|
|
error: replacing a value of type `T` with `T::default()` is better expressed using `std::mem::take`
|
2020-02-20 12:06:06 +01:00
|
|
|
--> $DIR/mem_replace.rs:23:13
|
2019-12-08 04:10:06 +01:00
|
|
|
|
|
|
|
|
LL | let _ = std::mem::replace(s, String::default());
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `std::mem::take(s)`
|
|
|
|
|
2019-12-08 18:26:37 +01:00
|
|
|
error: replacing a value of type `T` with `T::default()` is better expressed using `std::mem::take`
|
2020-02-20 12:06:06 +01:00
|
|
|
--> $DIR/mem_replace.rs:24:13
|
2019-12-08 18:26:37 +01:00
|
|
|
|
|
|
|
|
LL | let _ = std::mem::replace(s, Default::default());
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `std::mem::take(s)`
|
|
|
|
|
|
|
|
error: aborting due to 5 previous errors
|
2018-09-17 01:25:33 +02:00
|
|
|
|