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: resolve type inference issue with u32::MAX conversion #244

Merged
merged 2 commits into from
Mar 27, 2025

Conversation

An1MuS1111
Copy link
Contributor

Explicitly cast as_millis() result to u128 to avoid type inference error. This fixes compilation failure in notify-rust related to PartialOrd trait ambiguity when comparing duration.as_millis() with u32::MAX.into().

Refs: rust-lang/rust#E0283

@BSteffaniak
Copy link

@hoodie Could we get a patch release with this fix out? My builds are breaking because of this.

FWIW, I was able to also solve this using an explicit Into<u128> cast that retains the same exact functionality as is on main.

if duration.as_millis() > <u32 as Into<u128>>::into(u32::MAX)

@hoodie
Copy link
Owner

hoodie commented Mar 26, 2025

Could you help me with a PR here? The first fix seems to not pass clippy.

@hoodie
Copy link
Owner

hoodie commented Mar 27, 2025

You don't need to put the name of the crate in the commit message scope.

@An1MuS1111 An1MuS1111 closed this Mar 27, 2025
@An1MuS1111 An1MuS1111 reopened this Mar 27, 2025
@An1MuS1111
Copy link
Contributor Author

You don't need to put the name of the crate in the commit message scope.

Can you please check the latest one?

@hoodie
Copy link
Owner

hoodie commented Mar 27, 2025

Could you squash this once more? The first commits are failing the checks. Sorry I can only interact on my phone today.

@hoodie
Copy link
Owner

hoodie commented Mar 27, 2025

I'll be back on a computer tomorrow night. I'll just finish this then. Thanks for noticing and fixing this.

@An1MuS1111
Copy link
Contributor Author

An1MuS1111 commented Mar 27, 2025

I'll be back on a computer tomorrow night. I'll just finish this then. Thanks for noticing and fixing this.

I'm going to send it one more time today when I'm free... I'm on my phone too :3

Explicitly cast `as_millis()` result to `u128` to avoid type inference error.
This fixes compilation failure in `notify-rust` related to `PartialOrd` trait
ambiguity when comparing `duration.as_millis()` with `u32::MAX.into()`.

Refs: rust-lang/rust#E0283
Explicitly cast `as_millis()` result to `u128` to avoid type inference error.
This fixes compilation failure in `notify-rust` related to `PartialOrd` trait
ambiguity when comparing `duration.as_millis()` with `u32::MAX.into()`.

Refs: rust-lang/rust#E0283
@hoodie hoodie merged commit 0c6c3ff into hoodie:main Mar 27, 2025
24 checks passed
@hoodie
Copy link
Owner

hoodie commented Mar 27, 2025

Thank you for your help. I'll try to release this soon

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.

3 participants