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.)
Currently,
YieldProgress::noop()
is deprecated with the recommendation to "useyield_progress::Builder
instead". I am now thinking that this is a mistake, because code that consumesYieldProgress
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 butYieldProgress
, 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-yieldingYieldProgress
might be surprising.)