-
Notifications
You must be signed in to change notification settings - Fork 41
Fix more 1.92 Clippies #1968
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
base: develop
Are you sure you want to change the base?
Fix more 1.92 Clippies #1968
Conversation
OCaml Reference Validation ResultsRepository: https://github.com/MinaProtocol/mina.git Click to see full validation output |
|
676b5d2 to
4aa73c1
Compare
4aa73c1 to
2d00bf6
Compare
…py-path variant is the largest
2d00bf6 to
db82285
Compare
| --allow clippy::large_enum_variant \ | ||
| --allow clippy::result-large-err \ | ||
| --allow unused | ||
| --allow unused_assignments |
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.
Oh no... for the whole thing!?
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 actually don't know the difference between unused_assignments vs unused)
|
|
||
| /// External worker input. | ||
| #[derive(Debug, BinProtRead, BinProtWrite)] | ||
| #[expect(clippy::large_enum_variant, reason = "This enum is only used in tests")] |
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.
We should put this behind a feature flag if it's only used in tests
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.
Don't need to change in this PR, but can you create an issue before resolving the comment?
| Ok(snark_work::spec::Work::Transition((statement, witness))) | ||
| Ok(snark_work::spec::Work::Transition(( | ||
| statement, | ||
| Box::new(witness), |
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.
Curious to hear your opinion on this, but when it comes to wrapper types like this, I prefer to use witness.into(). That way, changes are minimized if we decide to have any other wrapper or anything like that.
(not a change for this PR, just interested in your thoughts)
|
|
||
| /// External worker input. | ||
| #[derive(Debug, BinProtRead, BinProtWrite)] | ||
| #[expect(clippy::large_enum_variant, reason = "This enum is only used in tests")] |
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.
Same comment
| pub type EventSourceActionWithMeta = redux::ActionWithMeta<EventSourceAction>; | ||
|
|
||
| #[derive(Serialize, Deserialize, Debug, Clone)] | ||
| #[expect(clippy::large_enum_variant, reason = "This enum extends super::Event")] |
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'm not sure if I agree with this one. This should almost certainly be boxed, no?
Also... a nit... but... I would say "wraps," not "extends"
| /// reason this type is private while functions wrapping the whole call | ||
| /// to the service are exposed as the service's methods. | ||
| #[allow(dead_code)] // TODO | ||
| #[expect( |
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.
expect?
| .map(|jobs| { | ||
| let jobs = jobs.collect::<Vec<JobValueWithIndex<'_>>>(); | ||
| let mut iter = jobs.iter().peekable(); | ||
| let iter = jobs.iter().peekable(); |
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.
😎
| *state = Self::LedgerLoadSuccess { | ||
| time: meta.time(), | ||
| data: data.clone(), | ||
| data: *data.clone(), |
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.
Really!? Clone::clone should always return an owned type, no?
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.
Ah nvm... data is &Box
| let rpc_state = &state.p2p.get_ready_peer(peer_id)?.channels.rpc; | ||
| if *req_id == rpc_state.pending_local_rpc_id()? { | ||
| return Some(format!("Request: {}", rpc_state.pending_local_rpc()?)); | ||
| } |
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.
This is gross... but it was gross before... I just couldn't look at it without commenting
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.
yikes
Description
Addresses the
clippy::{large_enum_variants,result_large_err}lints introduced by the 1.92 upgrade. Some enum variants were boxed where it made sense, others we're allowed as the size difference between the largest/second-largest wasn't too big to warrant a larger refactor.Removes the
--allow clippy::{large_enum_variants,result_large_err}frommake lint[-beta]Additionally, the
--allow unusedwas changed to--allow unused_assignments, which is the more specific lint that was triggering #1893. Seeing as that's likely a compiler bug, we're keeping that issue open. However,--allow unuseddid allow somedead_codeto slip through the cracks, so that's been addressed here too.Related Issue(s)
Closes #1895
Type of Change
Testing
Code should compile and CI should pass. There are no functional changes in this PR.
Changelog Entry