Skip to content

Commit 71f1e05

Browse files
taiki-ecramertj
authored andcommitted
Remove unnecessary trait bounds from the definition of combinators
1 parent fc981c7 commit 71f1e05

38 files changed

+48
-54
lines changed

futures-test/src/future/pending_once.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use pin_utils::{unsafe_pinned, unsafe_unpinned};
1111
/// method.
1212
#[derive(Debug, Clone)]
1313
#[must_use = "futures do nothing unless you `.await` or poll them"]
14-
pub struct PendingOnce<Fut: Future> {
14+
pub struct PendingOnce<Fut> {
1515
future: Fut,
1616
polled_before: bool,
1717
}

futures-util/src/future/catch_unwind.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use std::panic::{catch_unwind, UnwindSafe, AssertUnwindSafe};
88
/// Future for the [`catch_unwind`](super::FutureExt::catch_unwind) method.
99
#[derive(Debug)]
1010
#[must_use = "futures do nothing unless you `.await` or poll them"]
11-
pub struct CatchUnwind<Fut> where Fut: Future {
11+
pub struct CatchUnwind<Fut> {
1212
future: Fut,
1313
}
1414

futures-util/src/future/flatten.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ use pin_utils::unsafe_pinned;
99
#[must_use = "futures do nothing unless you `.await` or poll them"]
1010
pub struct Flatten<Fut>
1111
where Fut: Future,
12-
Fut::Output: Future,
1312
{
1413
state: Chain<Fut, Fut::Output, ()>,
1514
}
@@ -29,7 +28,7 @@ impl<Fut> Flatten<Fut>
2928

3029
impl<Fut> fmt::Debug for Flatten<Fut>
3130
where Fut: Future + fmt::Debug,
32-
Fut::Output: Future + fmt::Debug,
31+
Fut::Output: fmt::Debug,
3332
{
3433
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
3534
f.debug_struct("Flatten")

futures-util/src/future/fuse.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use pin_utils::unsafe_pinned;
66
/// Future for the [`fuse`](super::FutureExt::fuse) method.
77
#[derive(Debug)]
88
#[must_use = "futures do nothing unless you `.await` or poll them"]
9-
pub struct Fuse<Fut: Future> {
9+
pub struct Fuse<Fut> {
1010
future: Option<Fut>,
1111
}
1212

futures-util/src/future/inspect.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use pin_utils::{unsafe_pinned, unsafe_unpinned};
66
/// Future for the [`inspect`](super::FutureExt::inspect) method.
77
#[derive(Debug)]
88
#[must_use = "futures do nothing unless you `.await` or poll them"]
9-
pub struct Inspect<Fut, F> where Fut: Future {
9+
pub struct Inspect<Fut, F> {
1010
future: Fut,
1111
f: Option<F>,
1212
}

futures-util/src/future/into_stream.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use pin_utils::unsafe_pinned;
88
/// Stream for the [`into_stream`](super::FutureExt::into_stream) method.
99
#[must_use = "streams do nothing unless polled"]
1010
#[derive(Debug)]
11-
pub struct IntoStream<Fut: Future> {
11+
pub struct IntoStream<Fut> {
1212
inner: Once<Fut>
1313
}
1414

futures-util/src/io/buf_reader.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ impl<R: AsyncRead> AsyncBufRead for BufReader<R> {
199199
}
200200
}
201201

202-
impl<R: AsyncRead + fmt::Debug> fmt::Debug for BufReader<R> {
202+
impl<R: fmt::Debug> fmt::Debug for BufReader<R> {
203203
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
204204
f.debug_struct("BufReader")
205205
.field("reader", &self.inner)

futures-util/src/io/buf_writer.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ impl<W: AsyncWrite> AsyncWrite for BufWriter<W> {
156156
}
157157
}
158158

159-
impl<W: AsyncWrite + fmt::Debug> fmt::Debug for BufWriter<W> {
159+
impl<W: fmt::Debug> fmt::Debug for BufWriter<W> {
160160
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
161161
f.debug_struct("BufWriter")
162162
.field("writer", &self.inner)

futures-util/src/io/close.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use std::pin::Pin;
77
/// Future for the [`close`](super::AsyncWriteExt::close) method.
88
#[derive(Debug)]
99
#[must_use = "futures do nothing unless you `.await` or poll them"]
10-
pub struct Close<'a, W: ?Sized + Unpin> {
10+
pub struct Close<'a, W: ?Sized> {
1111
writer: &'a mut W,
1212
}
1313

futures-util/src/io/copy_into.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use pin_utils::unsafe_pinned;
99
/// Future for the [`copy_into`](super::AsyncReadExt::copy_into) method.
1010
#[derive(Debug)]
1111
#[must_use = "futures do nothing unless you `.await` or poll them"]
12-
pub struct CopyInto<'a, R: AsyncRead, W: ?Sized> {
12+
pub struct CopyInto<'a, R, W: ?Sized> {
1313
inner: CopyBufInto<'a, BufReader<R>, W>,
1414
}
1515

0 commit comments

Comments
 (0)