-
Notifications
You must be signed in to change notification settings - Fork 892
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 most clippy::pedantic lints #869
Merged
Merged
Conversation
This file contains 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
“casting `bool` to `u8` is more cleanly stated with `u8::from(_)`” https://rust-lang.github.io/rust-clippy/master/index.html#cast_lossless Signed-off-by: Anders Kaseorg <andersk@mit.edu>
“casting `usize` to `u8` may truncate the value” https://rust-lang.github.io/rust-clippy/master/index.html#cast_possible_truncation Signed-off-by: Anders Kaseorg <andersk@mit.edu>
“used `cloned` where `copied` could be used instead” https://rust-lang.github.io/rust-clippy/master/index.html#cloned_instead_of_copied Signed-off-by: Anders Kaseorg <andersk@mit.edu>
https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown Signed-off-by: Anders Kaseorg <andersk@mit.edu>
https://rust-lang.github.io/rust-clippy/master/index.html#explicit_deref_methods Signed-off-by: Anders Kaseorg <andersk@mit.edu>
“it is more concise to loop over references to containers instead of using explicit iteration methods” https://rust-lang.github.io/rust-clippy/master/index.html#explicit_iter_loop Signed-off-by: Anders Kaseorg <andersk@mit.edu>
https://rust-lang.github.io/rust-clippy/master/index.html#from_iter_instead_of_collect Signed-off-by: Anders Kaseorg <andersk@mit.edu>
https://rust-lang.github.io/rust-clippy/master/index.html#if_not_else Signed-off-by: Anders Kaseorg <andersk@mit.edu>
“adding items after statements is confusing, since items exist from the start of the scope” https://rust-lang.github.io/rust-clippy/master/index.html#items_after_statements Signed-off-by: Anders Kaseorg <andersk@mit.edu>
https://rust-lang.github.io/rust-clippy/master/index.html#let_underscore_drop Signed-off-by: Anders Kaseorg <andersk@mit.edu>
https://rust-lang.github.io/rust-clippy/master/index.html#manual_string_new Signed-off-by: Anders Kaseorg <andersk@mit.edu>
https://rust-lang.github.io/rust-clippy/master/index.html#map_unwrap_or Signed-off-by: Anders Kaseorg <andersk@mit.edu>
https://rust-lang.github.io/rust-clippy/master/index.html#match_bool Signed-off-by: Anders Kaseorg <andersk@mit.edu>
“this expression mutably borrows a mutable reference. Consider reborrowing” https://rust-lang.github.io/rust-clippy/master/index.html#mut_mut Signed-off-by: Anders Kaseorg <andersk@mit.edu>
“this argument is passed by value, but not consumed in the function body” https://rust-lang.github.io/rust-clippy/master/index.html#needless_pass_by_value Signed-off-by: Anders Kaseorg <andersk@mit.edu>
https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure_for_method_calls Signed-off-by: Anders Kaseorg <andersk@mit.edu>
https://rust-lang.github.io/rust-clippy/master/index.html#redundant_else Signed-off-by: Anders Kaseorg <andersk@mit.edu>
https://rust-lang.github.io/rust-clippy/master/index.html#single_match_else Signed-off-by: Anders Kaseorg <andersk@mit.edu>
“consider using a state machine or refactoring bools into two-variant enums” https://rust-lang.github.io/rust-clippy/master/index.html#struct_excessive_bools Signed-off-by: Anders Kaseorg <andersk@mit.edu>
https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args Signed-off-by: Anders Kaseorg <andersk@mit.edu>
https://rust-lang.github.io/rust-clippy/master/index.html#unreadable_literal Signed-off-by: Anders Kaseorg <andersk@mit.edu>
andersk
force-pushed
the
clippy-pedantic
branch
from
November 22, 2022 04:08
e4b3e7e
to
755cb9f
Compare
Wow, respect! Will rebase + merge. |
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.
🐙 Consider merging this with Create a merge commit or Rebase and merge rather than Squash and merge (documentation), as squashing would destroy the separation between individual commits whose messages provide context for each change.
This appeases all
clippy::pedantic
lints except the following.Result<>
wrappers detected as unnecessary are places where we’re ignoring errors that we probably shouldn’t