Skip to content

Commit

Permalink
stream: move the adapter types to an inline mod
Browse files Browse the repository at this point in the history
Created an inline adapters mod that contains the adapter types, to
keep the tokio_stream interface organized.

Fixes: #6656
  • Loading branch information
sharpened-nacho committed Jun 25, 2024
1 parent fe0f8a2 commit 55c7899
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
13 changes: 9 additions & 4 deletions tokio-stream/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,15 @@ pub mod wrappers;

mod stream_ext;
pub use stream_ext::{collect::FromStream, StreamExt};
pub use stream_ext::{
AllFuture, AnyFuture, Chain, Filter, FilterMap, FoldFuture, Fuse, Map, MapWhile, Merge, Next,
Peekable, Skip, SkipWhile, Take, TakeWhile, Then, TryNext,
};
/// Adapters for types that implement the `Stream` trait.
/// Created through the tokio [`StreamExt`](crate::stream_ext::StreamExt) methods.
pub mod adapters {
pub use crate::stream_ext::{
AllFuture, AnyFuture, Chain, Filter, FilterMap, FoldFuture, Fuse, Map, MapWhile, Merge,
Next, Peekable, Skip, SkipWhile, Take, TakeWhile, Then, TryNext,
};
}

cfg_time! {
pub use stream_ext::timeout::{Elapsed, Timeout};
}
Expand Down
3 changes: 2 additions & 1 deletion tokio-stream/tests/stream_chain.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
use tokio_stream::{self as stream, Chain, Stream, StreamExt};
use tokio_stream::{self as stream, Stream, StreamExt};
use tokio_test::{assert_pending, assert_ready, task};

mod support {
pub(crate) mod mpsc;
}

use support::mpsc;
use tokio_stream::adapters::Chain;

#[tokio::test]
async fn basic_usage() {
Expand Down

0 comments on commit 55c7899

Please sign in to comment.