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 diff --git a/blockchain/message_pool/src/msgpool/msg_pool.rs b/blockchain/message_pool/src/msgpool/msg_pool.rs index 6b14b1ce6ba1..f520e670ee38 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<SignedMessage> = local_msgs.iter().cloned().collect(); - - for k in msg_vec.into_iter() { + for k in local_msgs.iter().cloned().collect::<Vec<SignedMessage>>() { self.add(k.clone()).await.unwrap_or_else(|err| { if err == Error::SequenceTooLow { warn!("error adding message: {:?}", err);