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

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

Closed
virtualritz opened this issue Jun 6, 2024 · 2 comments
Closed

Comments

@virtualritz
Copy link

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
Copy link
Author

Probably you meant || instead of && here?

@Roughsketch
Copy link
Owner

Fix was included in #34

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

No branches or pull requests

2 participants