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
+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),
)?;
}