Our great sponsors
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
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
[2] https://github.com/rust-lang/rust/issues/64260
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
[2] https://github.com/rust-lang/rust/issues/64260