-
Notifications
You must be signed in to change notification settings - Fork 270
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
More clippy #261
More clippy #261
Conversation
Clippy warns of missing `is_empty`, trivially implement it by calling through to `self.data.is_empty()`.
Found by clippy. We don't need a `return` for the final statement.
The reason clippy isn't in CI is that it's too noisy and the attributes needed to shut it up result in errors/warnings about "unknown attributes" from rustc 1.29. I haven't revisited this decision in a few years - maybe things are better now. Certainly this PR found some really bizarre stuff, such as the I also need to read up on My local CI scripts show the first failure on e42f3f8
|
2 from 2 CI denials today :) What scripts are you running locally please so I can do the same and not waste your time too much. Oh poo, now I'm not building with What's your workflow to get around this please (only when you get time to answer, no rush) i.e., build with all features except Do you just use
|
This helper never returns an error, remove the `Result` return type. Found by clippy.
Clippy emits warning: warning: passing a unit value to a function Just return `Ok(())` after calling `fill_bytes`.
Type is `Copy`, no need for clone.
Currently we are misusing `map` on an iterator to loop `n` times, additionally the assertion is pointless. Use a for loop and assert against the length of the set.
Suggested by clippy, we need to use ManuallyDrop for these types in order to correctly free up the memory.
fb7e1f3
to
a584643
Compare
Yep - all features except
as the second. But this is a pretty new thing and I'm iterating rapidly (I've changed the structure of the input 4 or 5 times this week) so I wouldn't rely on this. I have related scripts which (attempt to) match commits to pull requests and which attach local review notes to things. Don't worry about wasting my time :) it takes about a minute for me to run through a PR checking that it doesn't do weird unsafe things or access the filesystem, then I just start running that script and read Reddit until my CPU fan stops whirring. |
Ah! So, the reason for the In fact, the drop impl on these context objects is a no-op, so there is no problem here ... except that the point of this unit test was to make sure it really was a no-op! So the test was broken and clippy saved us. |
Sweet, long live clippy. |
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.
ack a584643
I have no idea what I was thinking with this comment. The The commit message here which suggests that the use of The original test was correct, though a little weird. clippy was wrong and the new code is wrong. BTW the clippy lint was moved from Clippy into Rustc in rust-lang/rust#111530 as deny_by_default, which would have broken our code 🙄 but whatever. |
|
Oh not to worry, I see you fixed it in #645 |
We recently merged some work that introduced a bunch of clippy warnings. Lets keep clippy quiet and clean them up. Is there a reason we don't have CI catching these?
Patches are all trivial except the last two, particularly I just blindly followed clippy for the last one, I've not encountered
ManuallyDrop
before.