Conversation
Two pre-existing lints fail `cargo clippy --all-targets --all-features -- -Dwarnings` on clippy 1.97: - `useless_conversion` in the blindbit tweak subscriber: `futures::stream::iter` takes an `IntoIterator`, so calling `.into_iter()` on the map first is redundant. - `question_mark` in the v2 CLI: the spawned task matched on the node error only to return it unchanged. Returning the future's result directly is equivalent and matches how the other subscribers are spawned a few lines below. Neither changes behaviour.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
cargo clippy --all-targets --all-features -- -Dwarningscurrently fails on master with two lints. Both are style-only; neither changes behaviour.clippy::useless_conversion—oracles/src/tweaks/blindbit.rs:184futures::stream::itertakes anIntoIterator, so calling.into_iter()on the map first is redundant.clippy::question_mark—cli/v2/src/main.rs:413The spawned task matched on the node error only to return it unchanged. Note that clippy's own suggestion (
node.run().await?;followed byOk(())) does not compile — with the explicitreturn Err(e)gone there is nothing left to infer theResult's error type from, so it fails withE0282. Returning the future's result directly is equivalent, avoids the annotation, and matches howblindbit_subscriberand the other tasks are spawned a few lines below.These only fire on newer clippy — observed on 1.97 — which is likely why CI hasn't caught them yet.
Notes to the reviewers
Neither hunk can change runtime behaviour:
stream::itercalls.into_iter()itself, and in the CLI theResultgoes into aJoinHandlethat nothing awaits, before or after.Checklists
All Submissions:
cargo fmtandcargo clippybefore committing