diff --git a/src/fs/file.rs b/src/fs/file.rs index b2a897eb..bdf93474 100644 --- a/src/fs/file.rs +++ b/src/fs/file.rs @@ -12,7 +12,7 @@ use cfg_if::cfg_if; use crate::fs::{Metadata, Permissions}; use crate::future; -use crate::io::{self, Seek, SeekFrom, Read, Write}; +use crate::io::{self, Read, Seek, SeekFrom, Write}; use crate::prelude::*; use crate::task::{self, blocking, Context, Poll, Waker}; diff --git a/src/io/cursor.rs b/src/io/cursor.rs index 89758408..2dfc8a75 100644 --- a/src/io/cursor.rs +++ b/src/io/cursor.rs @@ -1,6 +1,6 @@ use std::pin::Pin; -use crate::io::{self, IoSlice, IoSliceMut, Seek, SeekFrom, BufRead, Read, Write}; +use crate::io::{self, BufRead, IoSlice, IoSliceMut, Read, Seek, SeekFrom, Write}; use crate::task::{Context, Poll}; /// A `Cursor` wraps an in-memory buffer and provides it with a diff --git a/src/io/read/read_exact.rs b/src/io/read/read_exact.rs index d6f02180..c970f431 100644 --- a/src/io/read/read_exact.rs +++ b/src/io/read/read_exact.rs @@ -2,8 +2,8 @@ use std::mem; use std::pin::Pin; use crate::future::Future; -use crate::task::{Context, Poll}; use crate::io::{self, Read}; +use crate::task::{Context, Poll}; #[doc(hidden)] #[allow(missing_debug_implementations)] diff --git a/src/io/read/read_vectored.rs b/src/io/read/read_vectored.rs index 15fecfa2..8e52ba2d 100644 --- a/src/io/read/read_vectored.rs +++ b/src/io/read/read_vectored.rs @@ -1,7 +1,7 @@ use std::pin::Pin; -use crate::io::{self, Read, IoSliceMut}; use crate::future::Future; +use crate::io::{self, IoSliceMut, Read}; use crate::task::{Context, Poll}; #[doc(hidden)] diff --git a/src/io/stdin.rs b/src/io/stdin.rs index cbf7fc4d..d2e9ec04 100644 --- a/src/io/stdin.rs +++ b/src/io/stdin.rs @@ -3,8 +3,8 @@ use std::sync::Mutex; use cfg_if::cfg_if; -use crate::io::{self, Read}; use crate::future::{self, Future}; +use crate::io::{self, Read}; use crate::task::{blocking, Context, Poll}; /// Constructs a new handle to the standard input of the current process. diff --git a/src/io/stdout.rs b/src/io/stdout.rs index b5fcccff..b7fee709 100644 --- a/src/io/stdout.rs +++ b/src/io/stdout.rs @@ -4,8 +4,8 @@ use std::sync::Mutex; use cfg_if::cfg_if; use crate::future::Future; -use crate::task::{blocking, Context, Poll}; use crate::io::{self, Write}; +use crate::task::{blocking, Context, Poll}; /// Constructs a new handle to the standard output of the current process. /// diff --git a/src/io/write/write_vectored.rs b/src/io/write/write_vectored.rs index d4e2da7d..5f8492b7 100644 --- a/src/io/write/write_vectored.rs +++ b/src/io/write/write_vectored.rs @@ -1,8 +1,8 @@ use std::pin::Pin; use crate::future::Future; +use crate::io::{self, IoSlice, Write}; use crate::task::{Context, Poll}; -use crate::io::{self, Write, IoSlice}; #[doc(hidden)] #[allow(missing_debug_implementations)] diff --git a/src/prelude.rs b/src/prelude.rs index 7ad894fe..d28ec643 100644 --- a/src/prelude.rs +++ b/src/prelude.rs @@ -21,7 +21,7 @@ pub use crate::io::Read as _; pub use crate::io::Seek as _; #[doc(no_inline)] pub use crate::io::Write as _; -#[doc(no_inline)] +#[doc(hidden)] pub use crate::stream::Stream; #[doc(no_inline)] pub use crate::task_local; @@ -34,5 +34,3 @@ pub use crate::io::ReadExt as _; pub use crate::io::SeekExt as _; #[doc(hidden)] pub use crate::io::WriteExt as _; -#[doc(hidden)] -pub use crate::stream::stream::Stream as _; diff --git a/src/stream/mod.rs b/src/stream/mod.rs index da79b193..5e17aa56 100644 --- a/src/stream/mod.rs +++ b/src/stream/mod.rs @@ -26,20 +26,12 @@ use cfg_if::cfg_if; pub use empty::{empty, Empty}; pub use once::{once, Once}; pub use repeat::{repeat, Repeat}; -pub use stream::{Fuse, Scan, Take, Zip}; +pub use stream::{Fuse, Scan, Stream, Take, Zip}; mod empty; mod once; mod repeat; -pub(crate) mod stream; - -cfg_if! { - if #[cfg(feature = "docs")] { - pub use stream::Stream; - } else { - pub use futures_core::stream::Stream; - } -} +mod stream; cfg_if! { if #[cfg(any(feature = "unstable", feature = "docs"))] { diff --git a/src/stream/stream/scan.rs b/src/stream/stream/scan.rs index cd447887..222022b8 100644 --- a/src/stream/stream/scan.rs +++ b/src/stream/stream/scan.rs @@ -24,9 +24,9 @@ impl Scan { impl Unpin for Scan {} -impl Stream for Scan +impl futures_core::stream::Stream for Scan where - S: crate::stream::Stream, + S: Stream, F: FnMut(&mut St, S::Item) -> Option, { type Item = B; diff --git a/src/stream/stream/zip.rs b/src/stream/stream/zip.rs index 706dbfa0..05f9967e 100644 --- a/src/stream/stream/zip.rs +++ b/src/stream/stream/zip.rs @@ -5,13 +5,13 @@ use crate::stream::Stream; use crate::task::{Context, Poll}; /// An iterator that iterates two other iterators simultaneously. -pub struct Zip { +pub struct Zip { item_slot: Option, first: A, second: B, } -impl fmt::Debug for Zip { +impl fmt::Debug for Zip { fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result { fmt.debug_struct("Zip") .field("first", &self.first) @@ -20,9 +20,9 @@ impl fmt::Debug for Zip { } } -impl Unpin for Zip {} +impl Unpin for Zip {} -impl Zip { +impl Zip { pub(crate) fn new(first: A, second: B) -> Self { Zip { item_slot: None,