Skip to content

Commit 1fa1968

Browse files
author
Stjepan Glavina
committed
Fix compilation errors around Stream
1 parent edfa235 commit 1fa1968

File tree

11 files changed

+16
-26
lines changed

11 files changed

+16
-26
lines changed

src/fs/file.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use cfg_if::cfg_if;
1212

1313
use crate::fs::{Metadata, Permissions};
1414
use crate::future;
15-
use crate::io::{self, Seek, SeekFrom, Read, Write};
15+
use crate::io::{self, Read, Seek, SeekFrom, Write};
1616
use crate::prelude::*;
1717
use crate::task::{self, blocking, Context, Poll, Waker};
1818

src/io/cursor.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use std::pin::Pin;
22

3-
use crate::io::{self, IoSlice, IoSliceMut, Seek, SeekFrom, BufRead, Read, Write};
3+
use crate::io::{self, BufRead, IoSlice, IoSliceMut, Read, Seek, SeekFrom, Write};
44
use crate::task::{Context, Poll};
55

66
/// A `Cursor` wraps an in-memory buffer and provides it with a

src/io/read/read_exact.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ use std::mem;
22
use std::pin::Pin;
33

44
use crate::future::Future;
5-
use crate::task::{Context, Poll};
65
use crate::io::{self, Read};
6+
use crate::task::{Context, Poll};
77

88
#[doc(hidden)]
99
#[allow(missing_debug_implementations)]

src/io/read/read_vectored.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use std::pin::Pin;
22

3-
use crate::io::{self, Read, IoSliceMut};
43
use crate::future::Future;
4+
use crate::io::{self, IoSliceMut, Read};
55
use crate::task::{Context, Poll};
66

77
#[doc(hidden)]

src/io/stdin.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ use std::sync::Mutex;
33

44
use cfg_if::cfg_if;
55

6-
use crate::io::{self, Read};
76
use crate::future::{self, Future};
7+
use crate::io::{self, Read};
88
use crate::task::{blocking, Context, Poll};
99

1010
/// Constructs a new handle to the standard input of the current process.

src/io/stdout.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ use std::sync::Mutex;
44
use cfg_if::cfg_if;
55

66
use crate::future::Future;
7-
use crate::task::{blocking, Context, Poll};
87
use crate::io::{self, Write};
8+
use crate::task::{blocking, Context, Poll};
99

1010
/// Constructs a new handle to the standard output of the current process.
1111
///

src/io/write/write_vectored.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
use std::pin::Pin;
22

33
use crate::future::Future;
4+
use crate::io::{self, IoSlice, Write};
45
use crate::task::{Context, Poll};
5-
use crate::io::{self, Write, IoSlice};
66

77
#[doc(hidden)]
88
#[allow(missing_debug_implementations)]

src/prelude.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ pub use crate::io::Read as _;
2121
pub use crate::io::Seek as _;
2222
#[doc(no_inline)]
2323
pub use crate::io::Write as _;
24-
#[doc(no_inline)]
24+
#[doc(hidden)]
2525
pub use crate::stream::Stream;
2626
#[doc(no_inline)]
2727
pub use crate::task_local;
@@ -34,5 +34,3 @@ pub use crate::io::ReadExt as _;
3434
pub use crate::io::SeekExt as _;
3535
#[doc(hidden)]
3636
pub use crate::io::WriteExt as _;
37-
#[doc(hidden)]
38-
pub use crate::stream::stream::Stream as _;

src/stream/mod.rs

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,20 +26,12 @@ use cfg_if::cfg_if;
2626
pub use empty::{empty, Empty};
2727
pub use once::{once, Once};
2828
pub use repeat::{repeat, Repeat};
29-
pub use stream::{Fuse, Scan, Take, Zip};
29+
pub use stream::{Fuse, Scan, Stream, Take, Zip};
3030

3131
mod empty;
3232
mod once;
3333
mod repeat;
34-
pub(crate) mod stream;
35-
36-
cfg_if! {
37-
if #[cfg(feature = "docs")] {
38-
pub use stream::Stream;
39-
} else {
40-
pub use futures_core::stream::Stream;
41-
}
42-
}
34+
mod stream;
4335

4436
cfg_if! {
4537
if #[cfg(any(feature = "unstable", feature = "docs"))] {

src/stream/stream/scan.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ impl<S, St, F> Scan<S, St, F> {
2424

2525
impl<S: Unpin, St, F> Unpin for Scan<S, St, F> {}
2626

27-
impl<S, St, F, B> Stream for Scan<S, St, F>
27+
impl<S, St, F, B> futures_core::stream::Stream for Scan<S, St, F>
2828
where
29-
S: crate::stream::Stream,
29+
S: Stream,
3030
F: FnMut(&mut St, S::Item) -> Option<B>,
3131
{
3232
type Item = B;

src/stream/stream/zip.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ use crate::stream::Stream;
55
use crate::task::{Context, Poll};
66

77
/// An iterator that iterates two other iterators simultaneously.
8-
pub struct Zip<A: crate::stream::stream::Stream, B> {
8+
pub struct Zip<A: Stream, B> {
99
item_slot: Option<A::Item>,
1010
first: A,
1111
second: B,
1212
}
1313

14-
impl<A: fmt::Debug + Stream, B: fmt::Debug> fmt::Debug for Zip<A, B> {
14+
impl<A: Stream + fmt::Debug, B: fmt::Debug> fmt::Debug for Zip<A, B> {
1515
fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
1616
fmt.debug_struct("Zip")
1717
.field("first", &self.first)
@@ -20,9 +20,9 @@ impl<A: fmt::Debug + Stream, B: fmt::Debug> fmt::Debug for Zip<A, B> {
2020
}
2121
}
2222

23-
impl<A: Unpin + Stream, B: Unpin> Unpin for Zip<A, B> {}
23+
impl<A: Stream + Unpin, B: Unpin> Unpin for Zip<A, B> {}
2424

25-
impl<A: crate::stream::stream::Stream, B> Zip<A, B> {
25+
impl<A: Stream, B> Zip<A, B> {
2626
pub(crate) fn new(first: A, second: B) -> Self {
2727
Zip {
2828
item_slot: None,

0 commit comments

Comments
 (0)