kpreid / yield-progress

Progress reporting and cooperative task yielding in Rust
Apache License 2.0
2 stars 0 forks source link

Un-deprecate `YieldProgress::noop()`? #18

Closed kpreid closed 6 months ago

kpreid commented 8 months ago

Currently, YieldProgress::noop() is deprecated with the recommendation to "use yield_progress::Builder instead". I am now thinking that this is a mistake, because code that consumes YieldProgress will frequently want to stub it out for tests, or have a “synchronous API” that also wants the underlying async code to not yield.

Both of these use cases can use the builder, but noop() means there is no need to import anything but YieldProgress, and re-exports for consumers don't need to include the builder (which improves API version compatibility).

(We could also have impl Default for YieldProgress, but that's considerably more dubious since a non-yielding YieldProgress might be surprising.)

kpreid commented 6 months ago

Done in 6f69961d7d7864203b67e7a94f1ff8ba1af5641c