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

Optimize imports #1430

Merged
merged 6 commits into from Apr 5, 2024
Merged

Conversation

MichaelOwenDyer
Copy link
Member

@MichaelOwenDyer MichaelOwenDyer commented Apr 3, 2024

Summary

This PR fixes some instances of redundant or deprecated path prefixes in the codebase.
This is a new PR after I screwed up the git history of #1422, sorry about that.

Motivation

Code style.

Details

  • Some numeric constants are currently imported from core, such as core::u64::MAX or core::f64::EPSILON. Clippy suggests that these be changed to the newer associated constants on the types themselves, e.g. u64::MAX and f64::EPSILON. Also, method calls like u64::max_value() have likewise been replaced with u64::MAX.
  • Some types are currently fully qualified despite a matching import. These redundant prefixes have been removed.
  • Some paths are currently prefixed with :: unnecessarily, which has been removed.
  • Instances of -f64::INFINITY have been replaced with f64::NEG_INFINITY.

Copy link
Member

@dhardy dhardy left a comment

Choose a reason for hiding this comment

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

Thanks

@dhardy dhardy merged commit bca078e into rust-random:master Apr 5, 2024
12 checks passed
@MichaelOwenDyer MichaelOwenDyer deleted the optimize-imports branch April 5, 2024 15:40
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.

None yet

2 participants