mirror of
https://github.com/async-rs/async-std.git
synced 2025-01-16 10:49:55 +00:00
Fix compilation errors around Stream
This commit is contained in:
parent
edfa2358a4
commit
1fa196812a
11 changed files with 16 additions and 26 deletions
|
@ -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};
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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)]
|
||||
|
|
|
@ -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)]
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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.
|
||||
///
|
||||
|
|
|
@ -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)]
|
||||
|
|
|
@ -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 _;
|
||||
|
|
|
@ -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"))] {
|
||||
|
|
|
@ -24,9 +24,9 @@ impl<S, St, F> Scan<S, St, F> {
|
|||
|
||||
impl<S: Unpin, St, F> Unpin for Scan<S, St, F> {}
|
||||
|
||||
impl<S, St, F, B> Stream for Scan<S, St, F>
|
||||
impl<S, St, F, B> futures_core::stream::Stream for Scan<S, St, F>
|
||||
where
|
||||
S: crate::stream::Stream,
|
||||
S: Stream,
|
||||
F: FnMut(&mut St, S::Item) -> Option<B>,
|
||||
{
|
||||
type Item = B;
|
||||
|
|
|
@ -5,13 +5,13 @@ use crate::stream::Stream;
|
|||
use crate::task::{Context, Poll};
|
||||
|
||||
/// An iterator that iterates two other iterators simultaneously.
|
||||
pub struct Zip<A: crate::stream::stream::Stream, B> {
|
||||
pub struct Zip<A: Stream, B> {
|
||||
item_slot: Option<A::Item>,
|
||||
first: A,
|
||||
second: B,
|
||||
}
|
||||
|
||||
impl<A: fmt::Debug + Stream, B: fmt::Debug> fmt::Debug for Zip<A, B> {
|
||||
impl<A: Stream + fmt::Debug, B: fmt::Debug> fmt::Debug for Zip<A, B> {
|
||||
fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
fmt.debug_struct("Zip")
|
||||
.field("first", &self.first)
|
||||
|
@ -20,9 +20,9 @@ impl<A: fmt::Debug + Stream, B: fmt::Debug> fmt::Debug for Zip<A, B> {
|
|||
}
|
||||
}
|
||||
|
||||
impl<A: Unpin + Stream, B: Unpin> Unpin for Zip<A, B> {}
|
||||
impl<A: Stream + Unpin, B: Unpin> Unpin for Zip<A, B> {}
|
||||
|
||||
impl<A: crate::stream::stream::Stream, B> Zip<A, B> {
|
||||
impl<A: Stream, B> Zip<A, B> {
|
||||
pub(crate) fn new(first: A, second: B) -> Self {
|
||||
Zip {
|
||||
item_slot: None,
|
||||
|
|
Loading…
Reference in a new issue