Fix clippy's performance lints (#1286)

* Fix clippy perf lints

* Cargo fmt

* Add  and  to lint rule in Makefile

* Fix some leftover clippy lints
This commit is contained in:
pscott
2020-06-25 16:04:08 +02:00
committed by GitHub
parent b3c01bf09d
commit 02174e21d8
26 changed files with 82 additions and 84 deletions

View File

@@ -529,7 +529,7 @@ impl<T: BeaconChainTypes> SyncManager<T> {
// otherwise, this is a range sync issue, notify the range sync
self.range_sync
.inject_error(&mut self.network, peer_id.clone(), request_id);
.inject_error(&mut self.network, peer_id, request_id);
}
fn peer_disconnect(&mut self, peer_id: &PeerId) {
@@ -667,7 +667,7 @@ impl<T: BeaconChainTypes> SyncManager<T> {
"last_peer" => format!("{:?}", parent_request.last_submitted_peer),
);
self.network
.downvote_peer(parent_request.last_submitted_peer.clone());
.downvote_peer(parent_request.last_submitted_peer);
return;
}
Err(e) => {
@@ -677,7 +677,7 @@ impl<T: BeaconChainTypes> SyncManager<T> {
"last_peer" => format!("{:?}", parent_request.last_submitted_peer),
);
self.network
.downvote_peer(parent_request.last_submitted_peer.clone());
.downvote_peer(parent_request.last_submitted_peer);
return;
}
}