Skip to content
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 warnings and bump srp and aucpace MSRV to 1.61 #144

Merged
merged 13 commits into from
Aug 15, 2023

Conversation

brxken128
Copy link
Contributor

@brxken128 brxken128 commented Aug 14, 2023

While playing around in the workspace (SPAKE2 specifically), I noticed that there were a tonne of clippy warnings so I decided to fix them all.

My only concern is the silencing of write via #[allow(clippy::unused_io_amount)] - I wonder if changing all of those writes to write_all would produce more-than-negligible performance losses. These were changed to write_all for correctness.

This changes the MSRV of srp and aucpace from 1.60.0 to 1.61.0 otherwise they won't build with some const fns (#93706 was added in 1.61.0)

@brxken128 brxken128 changed the title Fix clippy warnings for SPAKE2 Fix clippy warnings Aug 14, 2023
@tarcieri
Copy link
Member

cc @tritoke

@tritoke
Copy link
Contributor

tritoke commented Aug 14, 2023

Thanks for fixing these, I got quite busy writing my dissertation towards the end of finishing this so it's nice that it's been tidied up!

All of the .write calls should be .write_all, they are only in examples so it's never failed for me in testing but it's always worth using the right method :)

@newpavlov
Copy link
Member

It could be worth to also bump Clippy version in our CI job and if there are warnings in other crates, it would be nice to fix them as well.

@brxken128
Copy link
Contributor Author

Will draft this temporarily and get all of that done!

@brxken128 brxken128 marked this pull request as draft August 15, 2023 00:14
@tarcieri
Copy link
Member

@brxken128 you can bump aucpace MSRV if need be

@brxken128
Copy link
Contributor Author

brxken128 commented Aug 15, 2023

@brxken128 you can bump aucpace MSRV if need be

I think I broke builds anyway, probably removing the wrong pub(crate). Shouldn't be too hard to fix. I missed out --all-features.

I'll see what the new MSRV should be, from a glance 1.65.0 looks suitable but I'm not 100%.

Edit: 1.64.0 and 1.63.0 work, I forgot what version things were stabilized in so it's just trial-and-error now haha

Further edit: All should be good to go! 1.62.1 seemed to be the lowest, so I changed CI/the Cargo.toml file and the README. CI may need re-running though.

I was using cargo clippy --all-features -- -W clippy::pedantic -W clippy::correctness -W clippy::perf -W clippy::style -W clippy::suspicious -W clippy::complexity -A clippy::missing_errors_doc -W clippy::nursery -A clippy::module-name-repetitions -A clippy::similar-names -A clippy::needless-pass-by-value -D warnings so I hope all crates are thoroughly linted 😀

Another edit: Just realised my CI mistake, reverting now

@brxken128 brxken128 marked this pull request as ready for review August 15, 2023 02:20
@brxken128
Copy link
Contributor Author

After further testing, 1.61.0 is all that's needed for things to function - both srp and aucpace would need these changes though.

@brxken128 brxken128 changed the title Fix clippy warnings Fix clippy warnings and bump srp and aucpace MSRV to 1.61.0 Aug 15, 2023
@tritoke
Copy link
Contributor

tritoke commented Aug 15, 2023

@brxken128 fwiw there is a tool called cargo-msrv that uses a kind of git bisect style approach to find the MSRV and it means you don't need to install all the toolchains, have found it very useful in the past so I thought I'd mention it :)

@brxken128
Copy link
Contributor Author

@brxken128 fwiw there is a tool called cargo-msrv that uses a kind of git bisect style approach to find the MSRV and it means you don't need to install all the toolchains, have found it very useful in the past so I thought I'd mention it :)

Oh wow that does sound incredibly helpful, I'll add it to my toolkit. I have a taskfile which installs all of the helpful tooling and this'll definitely be included - thank you so much!

@tarcieri
Copy link
Member

tarcieri commented Aug 15, 2023

both srp and aucpace would need these changes though.

That's fine... can you bump them to the next minor version in Cargo.toml and add -pre though? (i.e. v0.2.0-pre for aucpace, v0.7.0-pre for srp)

aucpace/Cargo.toml Outdated Show resolved Hide resolved
aucpace/README.md Outdated Show resolved Hide resolved
@brxken128
Copy link
Contributor Author

both srp and aucpace would need these changes though.

That's fine... can you bump them to the next minor version in Cargo.toml and add -pre though? (i.e. v0.2.0-pre for aucpace, v0.7.0-pre for srp)

Done, and changed all 1.61.0 to 1.61

@tarcieri tarcieri changed the title Fix clippy warnings and bump srp and aucpace MSRV to 1.61.0 Fix clippy warnings and bump srp and aucpace MSRV to 1.61 Aug 15, 2023
@tarcieri tarcieri merged commit 7456548 into RustCrypto:master Aug 15, 2023
17 checks passed
@brxken128 brxken128 deleted the fix-clippy-warnings branch August 15, 2023 17:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants