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

chore: fix clippy warnings for rust 1.49 #1803

Merged
merged 1 commit into from
Dec 31, 2020

Conversation

@@ -1,6 +1,6 @@
use crate::config::Config;
use crate::multibimap::MultiBiMap;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fmt

@@ -1736,7 +1698,7 @@ impl ChainManager {
// Return all the blocks from this epoch range
let hashes: Vec<(Epoch, Hash)> = block_chain_range.collect();

Ok(hashes)
hashes
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you remove the let hashes? Or the collect forces you to use it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's try

@@ -1837,7 +1793,10 @@ impl ChainManager {

actix::fut::ok(())
})
.map_err(|e, _, _| log::error!("{:?}", e));
.map_err(|(), _, _| {
// Errors at this point should be impossible because we explicitly ignore them
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if it is impossible, should we put a panic?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can also remove that map_err, but I will put a panic so we can find any potential errors.

@tmpolaczyk tmpolaczyk force-pushed the rust-1-49 branch 4 times, most recently from 4c681b9 to 62b3fb8 Compare December 30, 2020 10:26
@tmpolaczyk
Copy link
Contributor Author

Disabled field_reassign_with_default lint because of false positives: rust-lang/rust-clippy#6515

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants