Use mem::take instead of mem::replace where appropriate (#5846)

* replace replace with take

* Update client/api/src/cht.rs

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>

* Update client/api/src/cht.rs

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
This commit is contained in:
Nikolay Volf
2020-04-30 15:53:36 +03:00
committed by GitHub
parent c3a6d8a881
commit c09bb1f350
11 changed files with 21 additions and 21 deletions
@@ -489,10 +489,10 @@ impl OverlayedChanges {
) {
assert!(self.prospective.is_empty());
(
std::mem::replace(&mut self.committed.top, Default::default())
std::mem::take(&mut self.committed.top)
.into_iter()
.map(|(k, v)| (k, v.value)),
std::mem::replace(&mut self.committed.children_default, Default::default())
std::mem::take(&mut self.committed.children_default)
.into_iter()
.map(|(sk, (v, ci))| (sk, (v.into_iter().map(|(k, v)| (k, v.value)), ci))),
)