3 ms·
As others pointed out, there also exists `bool::then` that always accepts a closure and doesn't have this issue. In fact both `bool::then` and `bool::then_some`
by lifthrasiir 3y ago
As others pointed out, there also exists `bool::then` that always accepts a closure and doesn't have this issue. In fact both `bool::then` and `bool::then_some` are originated from a single RFC [1], and people unanimously agreed on `bool::then` but not `bool::then_some`, so the latter spun off its own issue [2]. It seems that `bool::then_some` was eventually accepted mainly due to the lack of better alternatives---there were enough people wanting the value form and other pairs of method names were considered better.
[1] https://github.com/rust-lang/rfcs/pull/2757 https://github.com/rust-lang/rfcs/pull/2757
[2] https://github.com/rust-lang/rust/issues/64260 https://github.com/rust-lang/rust/issues/64260