Skip to content

Use None::<u64> instead of 0 to denote an absence of value #14957

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

Merged
merged 1 commit into from
Jun 2, 2025

Conversation

samueltardieu
Copy link
Contributor

clippy_lints::casts::utils::int_ty_to_nbits used to return 0 to indicate that the argument was not an integral type. It is more idiomatic to use Option<u64> as a return type.

Also, I've added a few FIXME: at places where only f32 and f64 are considered, as we now have f16 and f128 to deal with.

changelog: none

`clippy_lints::casts::utils::int_ty_to_nbits` used to return `0` to
indicate that the argument was not an integral type. It is more
idiomatic to use `Option<u64>` as a return type.
@rustbot
Copy link
Collaborator

rustbot commented Jun 2, 2025

r? @llogiq

rustbot has assigned @llogiq.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Jun 2, 2025
@llogiq
Copy link
Contributor

llogiq commented Jun 2, 2025

Thank you!

@llogiq llogiq added this pull request to the merge queue Jun 2, 2025
Merged via the queue into rust-lang:master with commit 6fa2866 Jun 2, 2025
11 checks passed
@samueltardieu samueltardieu deleted the casts-partial-cleanup branch June 2, 2025 13:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants