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

Style fixes #137

Merged
merged 4 commits into from
Dec 29, 2024
Merged

Style fixes #137

merged 4 commits into from
Dec 29, 2024

Conversation

samueltardieu
Copy link
Contributor

@samueltardieu samueltardieu commented Dec 22, 2023

Apply various style fixes found by Clippy:

  • Do not deconstruct an error to rebuild it right after
  • Remove useless as usize
  • Use char rather than &str as starts_with() argument
  • Remove useless references

@samueltardieu
Copy link
Contributor Author

I have separated the style fixes into various commits so that some could be removed if the maintainers prefer to let the code this way. This can be the case for the "Remove useless as usize" for example, as even though I don't find !0 as usize more readable than !0 (or usize::MAX as I would have used myself), some others may differ.

@samueltardieu samueltardieu force-pushed the style-fixes branch 2 times, most recently from a80c98b to 02a7fbe Compare December 22, 2023 20:30
@samueltardieu
Copy link
Contributor Author

Rebased on current master branch.

@samueltardieu
Copy link
Contributor Author

Is this a real failure? MacOS jobs just display "This job failed" without any info, did the jobs start?

@tgross35
Copy link
Contributor

@samueltardieu could you rebase this? I think the CI failures were just since GH disabled the old MacOS runners, this repo hasn't had maintenance in a little while.

(or usize::MAX as I would have used myself)

+1, could you change !0 to type::MAX?

@tgross35
Copy link
Contributor

There are also a few new failures as reported in #153, feel free to fix those as well then we can check Clippy in CI.

@samueltardieu
Copy link
Contributor Author

Done. I've also added new fixes in separate commits.

@tgross35
Copy link
Contributor

Ah I guess MSRV is the reason MAX isn't used. Hopefully we can increase this soon, but for now I suppose could you leave this as !0usize with // FIXME(msrv): use `usize::MAX` when available?

Copy link
Contributor

@tgross35 tgross35 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the quick updates!

@tgross35 tgross35 merged commit d6cac97 into rust-lang:master Dec 29, 2024
16 checks passed
@samueltardieu samueltardieu deleted the style-fixes branch December 29, 2024 16:14
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.

2 participants