Roughsketch / imagesize

Quickly probe the size of various image formats without reading the entire file.
MIT License
57 stars 12 forks source link

Clippy: `error: boolean expression will never evaluate to 'true'` #35

Closed virtualritz closed 2 months ago

virtualritz commented 2 months ago
error: boolean expression will never evaluate to 'true'
  --> src/formats/pnm.rs:59:8
   |
59 |     if header[1] < b'1' && header[1] > b'6' {
   |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: since `b'1'` < `b'6'`, the expression evaluates to false for any value of `header[1]`
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#impossible_comparisons
   = note: `#[deny(clippy::impossible_comparisons)]` on by default
virtualritz commented 2 months ago

Probably you meant || instead of && here?

Roughsketch commented 2 months ago

Fix was included in #34