fix(unnecessary_map_or): respect reduced applicability

This commit is contained in:
Ada Alakbarova 2026-01-10 15:31:52 +01:00
parent 1437ea04e8
commit 2e556c490b
No known key found for this signature in database

View file

@ -97,12 +97,12 @@ pub(super) fn check<'a>(
// being converted to `Some(5) == Some(5).then(|| 1)` isn't
// the same thing
let mut app = Applicability::MachineApplicable;
let inner_non_binding = Sugg::NonParen(Cow::Owned(format!(
"{wrap}({})",
Sugg::hir(cx, non_binding_location, "")
Sugg::hir_with_applicability(cx, non_binding_location, "", &mut app)
)));
let mut app = Applicability::MachineApplicable;
let binop = make_binop(
op.node,
&Sugg::hir_with_applicability(cx, recv, "..", &mut app),