Open hardfist opened 2 weeks ago
the original PR seems like it was merged before anyone's concerns were addressed. there were two positions expressed (all functions of this type should be annotated, or none), and neither were satisfied. usually i'm all for incremental PRs, but when it's a single trivial insertion, that seems a bit much.
my two cents is this should be a clippy pedantic (or even restriction) lint, nothing more.
Hm, would removing #[must_use]
on Option::insert
be a breaking change if someone #[expect(unused_must_use)]
for Option::insert
?
by the same logic, isn't adding a new lint a breaking change, as someone could be using #[deny(all)]
? i think that generally lint changes are never considered breaking changes, as there have been several cases of deny-by-default lints being added without being edition-gated.
Related to https://github.com/rust-lang/rust/pull/87196
I personally think
insert
is a more succinct and readable way than= Some(x)
and this seems should be a style preference and don't get why it's marked asmust_use
. what's more weird isOption::replace
is not marked asmust use
, so the syntax is kind of inconsistent to me.