Closed
Description
Had a use case where a certain input parameter must trigger some fallback behavior for a specific OS, but clippy reported it as a logical bug:
let v: Vec<_> = ...;
if cfg!(windows) && v.is_empty() {
// fallback behavior
} else {
// default behavior for Unix/non-empty param
}
Clippy is correctly reporting that this is equivalent to false && ...
on unix systems, but removing the first check (as per the suggestion) does not reflect the actual programmer intent
Metadata
Metadata
Assignees
Labels
No labels