Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix stable clippy::needless_collect #1238

Merged
merged 3 commits into from
Oct 18, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 1 addition & 3 deletions blockchain/message_pool/src/msgpool/msg_pool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down