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 VolfandBastian Köcher authored and GitHub committed 2020-04-30 12:53:36 +00:00
1 parent c3a6d8a881
commit c09bb1f350
11 files changed
+21 -21

No files matched your search

+2 -2
View File
@@ -232,7 +232,7 @@ pub fn for_each_cht_group<Header, I, F, P>(
functor_param = functor(
functor_param,
current_cht_num,
::std::mem::replace(&mut current_cht_blocks, Vec::new()),
std::mem::take(&mut current_cht_blocks),
)?;
}
@@ -244,7 +244,7 @@ pub fn for_each_cht_group<Header, I, F, P>(
functor(
functor_param,
current_cht_num,
::std::mem::replace(&mut current_cht_blocks, Vec::new()),
std::mem::take(&mut current_cht_blocks),
)?;
}