-
-
Couldn't load subscription status.
- Fork 476
Closed
Description
Lines 141 to 147 in bf8b5a9
| fn to_u64(self) -> Option<u64> { | |
| if self >= 0. && self <= ::core::u64::MAX as f64 { | |
| Some(self as u64) | |
| } else { | |
| None | |
| } | |
| } |
This function is wrong; to copy my comment from #958:
This is incorrect for 32-bit platforms. Check this out.
This isn't your fault;
to_u64forf64makes the same mistake. Hmm, even theTryFromin Rust 1.34 doesn't handle this conversion. I'm starting to hate this topic; seems simple but isn't.
CGMossa and burdges
Metadata
Metadata
Assignees
Labels
No labels