Closed
Description
The documentation for manual_is_variant_and
currently only specifically talks about how it lints .map(f).unwrap_or_default()
and mentions the following examples:
option.map(|a| a > 10).unwrap_or_default();
result.map(|a| a > 10).unwrap_or_default();
// should be
option.is_some_and(|a| a > 10);
result.is_ok_and(|a| a > 10);
At some point the lint was extended to also catch equals comparisons:
option.map(|a| a > 10) == Some(true);
result.map(|a| a > 10) == Ok(true);
// should be
option.is_some_and(|a| a > 10);
result.is_ok_and(|a| a > 10);
This isn't mentioned anywhere in the documentation.