-
Notifications
You must be signed in to change notification settings - Fork 56
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
Conversation
c2f169f
to
897aa85
Compare
bridges/ethereum/src/eth.rs
Outdated
@@ -1,6 +1,6 @@ | |||
use crate::config::Config; | |||
use crate::multibimap::MultiBiMap; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fmt
node/src/actors/chain_manager/mod.rs
Outdated
@@ -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 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
4c681b9
to
62b3fb8
Compare
62b3fb8
to
efa1727
Compare
Disabled |
Run
cargo +nightly clippy --all
and fix all the warnings. The Rust 1.49 update is scheduled for December 31st, but this PR can be merged now.These are the new lints fixed by this PR:
https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match
https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty
https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default
https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains
https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro
https://rust-lang.github.io/rust-clippy/master/index.html#result_unit_err
https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast
https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_wraps