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

refactor: use built-in {integer}::power_of_two methods #5909

Merged
merged 1 commit into from
Jul 5, 2024

Conversation

ErichDonGubler
Copy link
Member

@ErichDonGubler ErichDonGubler commented Jul 4, 2024

Connections

N/A

Description

This is a win overall because it can use an implementation in std,
and can often compile to an intrinsic to save instructions.

Upstream implementation:
https://github.com/rust-lang/rust/blob/9f877c9cd2c3f8f2f64df1e0c1804ad0682416d0/library/core/src/num/nonzero.rs#L1219

Testing

I think CI is persuasive enough here.

Checklist

  • Run cargo fmt.
  • Run cargo clippy. If applicable, add:
    • --target wasm32-unknown-unknown
    • --target wasm32-unknown-emscripten
  • Run cargo xtask test to run tests.
  • Add change to CHANGELOG.md. See simple instructions inside file. I don't think this is necessary.

@ErichDonGubler ErichDonGubler self-assigned this Jul 4, 2024
@ErichDonGubler ErichDonGubler force-pushed the push-rvoskywuwwty branch 2 times, most recently from aed5a61 to af3f41d Compare July 4, 2024 22:30
@ErichDonGubler ErichDonGubler marked this pull request as ready for review July 4, 2024 22:40
@ErichDonGubler ErichDonGubler requested a review from a team as a code owner July 4, 2024 22:40
This is a win overall because it can use an implementation in `std`,
_and_ can often compile to an intrinsic to save instructions.

Upstream implementation:
<https://github.com/rust-lang/rust/blob/9f877c9cd2c3f8f2f64df1e0c1804ad0682416d0/library/core/src/num/nonzero.rs#L1219>
@ErichDonGubler ErichDonGubler added the kind: refactor Making existing function faster or nicer label Jul 5, 2024
@cwfitzgerald cwfitzgerald merged commit d41b9ab into gfx-rs:trunk Jul 5, 2024
25 checks passed
@ErichDonGubler ErichDonGubler deleted the push-rvoskywuwwty branch July 5, 2024 03:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: refactor Making existing function faster or nicer
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

2 participants