mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-27 03:27:58 +00:00
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:
@@ -105,7 +105,7 @@ impl OffchainState {
|
||||
fn fulfill_expected(&mut self, id: u16) {
|
||||
if let Some(mut req) = self.expected_requests.remove(&RequestId(id)) {
|
||||
let response = req.response.take().expect("Response checked while added.");
|
||||
let headers = std::mem::replace(&mut req.response_headers, vec![]);
|
||||
let headers = std::mem::take(&mut req.response_headers);
|
||||
self.fulfill_pending_request(id, req, response, headers);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user