Closed SvenKeimpema closed 8 months ago
Hi!
You get the warning because checking that an u64
is greater than or equal to zero cannot fail. You can remove this comparison or mark it #[allow(unused_comparisons)]
.
For further questions regarding this (non-bug) topic, please rather use https://users.rust-lang.org/ or other community resources.
ok, that seemed to be it. of course kind of dumb mistake by me checking if u64 < 0 bc it can't although still seems like kind of a bug tho? or is it raising the warning because it can't ever be less then 0?
Yes, the warning is raised because u64 values can never be less than zero (unlike, for example, an i64 which may be negative).
I tried this code:
I expected to see this happen: explanation Expected the code to run without any type of warnings/errors.
Instead, this happened: explanation
warning here seems kind of strange bc i am comparing u64 with u64
Meta
rustc --version --verbose
: