|
|
|
|
|
by tasn
2000 days ago
|
|
Thanks a lot for the suggestion, I can't believe I didn't know about this. However I just tried it and I can't get it to work. I added this to the top of https://github.com/etesync/etebase-rs/blob/master/src/lib.rs and then ran `cargo clippy` #![warn(clippy::all)]
// Should fail https://rust-lang.github.io/rust-clippy/master/index.html#float_cmp
pub fn bool_test(x: f32, y: f32) -> bool {
x == y
}
Any idea what's missing? Why is it not failing?Edit: I know the above example is bad code, that's the point. I want clippy to complain about it but it doesn't. |
|
To my knowledge (it's been a while since I looked) fixing this behavior is blocked on cargo stabilizing something and has been for literal years.
That point of frustration aside, it's worth it...Clippy is an absolutely amazing piece of software. Both for pedagogy and normal development.
EDIT: Just dug up the issue. If you're on nightly you can use `cargo clippy -Z unstable-options` to avoid the clean/rebuild. Hopefully stuff gets stabilized soon. Here's the issue for reference: https://github.com/rust-lang/rust-clippy/issues/4612