-
-
Notifications
You must be signed in to change notification settings - Fork 53
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 clippy lints #404
Fix clippy lints #404
Conversation
I don't have this in any of my Rust projects, and I'd rather avoid it if possible. |
Removed it, would you be ok with adding it as an entry in |
No opinion on whether to have |
Good point, I'll just add it to my global ignore |
Closing since people can use a global |
Ah, sorry, I didn't pay attention and thought this PR just added |
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.
LGTM
I saw those clippy warnings before and wasn't yet sure how to handle these. I think we should more carefully look into whether or not those appear in performance critical code. And if yes, whether or not boxing the error type would be beneficial. Otherwise, I'm fine with |
Not sure why the doc checks failed, re-running |
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.
It's possible to add an optional cargo clippy
check, by making all other checks required, like CICD / all-jobs
in sharkdp/bat#2913.
Even if a new cargo clippy
check is optional, it still might encourage contributors to commit fewer linting errors into the codebase when they see a failing clippy check for their PR. clippy
usually says how to fix any errors, too.
The previous comment is in reference to #355 (comment), but I thought I'd bring it up here, since it's relevant again. |
numbat/src/tokenizer.rs
Outdated
@@ -694,6 +694,7 @@ pub fn tokenize(input: &str, code_source_id: usize) -> Result<Vec<Token>> { | |||
} | |||
|
|||
#[cfg(test)] | |||
#[allow(clippy::type_complexity)] |
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.
Happy to merge this PR if we can remove these excepts. Here and below.
I use a global rustfmt config which cause spurious changes when formatting in this repo. Adding an empty
.rustfmt.toml
in the root will force rustfmt to use the default options for line length/comment reflow/etc.I also wanted to run clippy while making some other changes and cleaned up the existing lints so I could see any new ones I added. The only interesting one was
result_large_err
in the typechecker where theOk
variants were around 32 bytes and some of theErr
s were a couple hundred bytes. I just allowed it for that whole module but I could go allow the individual functions it fired on, or use boxing to make theResult
smaller.