Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement FusedStream for all streams in ReadyChunks #2693

Merged
merged 1 commit into from Jan 20, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions futures-util/src/stream/stream/ready_chunks.rs
@@ -1,4 +1,4 @@
use crate::stream::Fuse;
use crate::stream::{Fuse, StreamExt};
use alloc::vec::Vec;
use core::pin::Pin;
use futures_core::stream::{FusedStream, Stream};
Expand All @@ -22,7 +22,7 @@ impl<St: Stream> ReadyChunks<St> {
pub(super) fn new(stream: St, capacity: usize) -> Self {
assert!(capacity > 0);

Self { stream: super::Fuse::new(stream), cap: capacity }
Self { stream: stream.fuse(), cap: capacity }
}

delegate_access_inner!(stream, St, (.));
Expand Down Expand Up @@ -75,7 +75,7 @@ impl<St: Stream> Stream for ReadyChunks<St> {
}
}

impl<St: FusedStream> FusedStream for ReadyChunks<St> {
impl<St: Stream> FusedStream for ReadyChunks<St> {
fn is_terminated(&self) -> bool {
self.stream.is_terminated()
}
Expand Down