futures-rs icon indicating copy to clipboard operation
futures-rs copied to clipboard

Should stream::Fuse drop the inner stream upon completion?

Open erickt opened this issue 4 years ago • 0 comments

I noticed that the implication for future::Fuse will drop the wrapped future when it completes, but stream::Fuse keeps around the stream after it's completed.

Would it make sense to make it drop the value? This would have the advantage of freeing up the interior resources, but it'd be a breaking change since APIs on stream::Fuse that expose the wrapped stream has a few public methods that expose the inner stream. If we ever cut a 0.4, it could be interesting if we switched methods like Fuse::get_ref() to return Option<&St> to allow this optimization.

erickt avatar Oct 14 '21 19:10 erickt