warning: unused return value of `std::mem::replace` that must be used
--> src/stores.rs:630:9
|
630 | std::mem::replace(self, HashMap::new());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(unused_must_use)]` on by default
= note: if you don't need the old value, you can just assign the new value directly
warning: 1 warning emitted
Is there a reason for using std::mem::replace instead of just *self = HashMap::new();?
My compiler keeps complaining about:
https://github.com/jaemk/cached/blob/21bd5c68a3b5aaab3aa63cb2a7b16bdc841a20e4/src/stores.rs#L630
Is there a reason for using
std::mem::replace
instead of just*self = HashMap::new();
?For convenience, incoming PR