From 1ae0acc608b108d64754a8965a7cdb9263721d44 Mon Sep 17 00:00:00 2001 From: Afr Schoe <58883403+q9f@users.noreply.github.com> Date: Thu, 30 Sep 2021 13:18:29 +0200 Subject: [PATCH 1/2] clippy: avoid collecting an interator when not needed (`#needless_collect`) --- blockchain/message_pool/src/msgpool/msg_pool.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/blockchain/message_pool/src/msgpool/msg_pool.rs b/blockchain/message_pool/src/msgpool/msg_pool.rs index f8e410d93ba2..af65b4f8b472 100644 --- a/blockchain/message_pool/src/msgpool/msg_pool.rs +++ b/blockchain/message_pool/src/msgpool/msg_pool.rs @@ -588,9 +588,7 @@ where /// Loads local messages to the message pool to be applied. pub async fn load_local(&mut self) -> Result<(), Error> { let mut local_msgs = self.local_msgs.write().await; - let msg_vec: Vec = local_msgs.iter().cloned().collect(); - - for k in msg_vec.into_iter() { + for k in local_msgs.iter().cloned().collect::>() { self.add(k.clone()).await.unwrap_or_else(|err| { if err == Error::SequenceTooLow { warn!("error adding message: {:?}", err); From 691e07bebad9f17aeb6f90db0c3823f8ec7a7120 Mon Sep 17 00:00:00 2001 From: /raw PONG _GHMoaCXLT <58883403+q9f@users.noreply.github.com> Date: Mon, 18 Oct 2021 16:21:01 +0100 Subject: [PATCH 2/2] ci: remove fixed warnings from clippy exceptions --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 526f5f1f0e14..ff6231de9f29 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -241,7 +241,7 @@ jobs: command: make license - run: name: cargo clippy - command: cargo clippy -- -D warnings -A clippy::needless_collect + command: cargo clippy -- -D warnings - run: name: cargo fmt command: cargo fmt --all -- --check