Assign map instead of using mem::replace.
This fixes build on latest nightly. The cause of the breakage
is this commit:
7c4ca59f4b
which added a #[must_use = "if you don't need the old value, you
can just assign the new value directly"] hint to mem::replace.
v0.7.x
parent
09f4a8f551
commit
386f50dbd2
|
@ -6,9 +6,6 @@ use managed::ManagedMap;
|
|||
use wire::{EthernetAddress, IpAddress};
|
||||
use time::{Duration, Instant};
|
||||
|
||||
#[cfg(any(feature = "std", feature = "alloc"))]
|
||||
use core::mem;
|
||||
|
||||
/// A cached neighbor.
|
||||
///
|
||||
/// A neighbor mapping translates from a protocol address to a hardware address,
|
||||
|
@ -104,7 +101,7 @@ impl<'a> Cache<'a> {
|
|||
.filter(|(_, v)| timestamp < v.expires_at)
|
||||
.collect();
|
||||
|
||||
mem::replace(map, new_btree_map);
|
||||
*map = new_btree_map;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue