Skip to content

Commit 6b3667d

Browse files
committed
Remove unnecessary types in extension_trait.
The remaining type requires the square brackets (for now) because a `ty` cannot immediately precede a `$(tt)*`.
1 parent c10d2d3 commit 6b3667d

File tree

7 files changed

+53
-54
lines changed

7 files changed

+53
-54
lines changed

src/future/future/mod.rs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ extension_trait! {
4545
/// ```
4646
#[cfg(feature = "unstable")]
4747
#[cfg_attr(feature = "docs", doc(cfg(unstable)))]
48-
fn delay(self, dur: Duration) -> impl Future<Output = Self::Output> [DelayFuture<Self>]
48+
fn delay(self, dur: Duration) -> [DelayFuture<Self>]
4949
where
5050
Self: Sized,
5151
{
@@ -70,8 +70,7 @@ extension_trait! {
7070
#[cfg_attr(feature = "docs", doc(cfg(unstable)))]
7171
fn flatten(
7272
self,
73-
) -> impl Future<Output = <Self::Output as IntoFuture>::Output>
74-
[FlattenFuture<Self, <Self::Output as IntoFuture>::Future>]
73+
) -> [FlattenFuture<Self, <Self::Output as IntoFuture>::Future>]
7574
where
7675
Self: Sized,
7776
<Self as Future>::Output: IntoFuture,
@@ -113,7 +112,7 @@ extension_trait! {
113112
fn race<F>(
114113
self,
115114
other: F,
116-
) -> impl Future<Output = <Self as std::future::Future>::Output> [Race<Self, F>]
115+
) -> [Race<Self, F>]
117116
where
118117
Self: std::future::Future + Sized,
119118
F: std::future::Future<Output = <Self as std::future::Future>::Output>,
@@ -159,7 +158,7 @@ extension_trait! {
159158
fn try_race<F, T, E>(
160159
self,
161160
other: F
162-
) -> impl Future<Output = <Self as std::future::Future>::Output> [TryRace<Self, F>]
161+
) -> [TryRace<Self, F>]
163162
where
164163
Self: std::future::Future<Output = Result<T, E>> + Sized,
165164
F: std::future::Future<Output = <Self as std::future::Future>::Output>,
@@ -196,7 +195,7 @@ extension_trait! {
196195
fn join<F>(
197196
self,
198197
other: F
199-
) -> impl Future<Output = (<Self as std::future::Future>::Output, <F as std::future::Future>::Output)> [Join<Self, F>]
198+
) -> [Join<Self, F>]
200199
where
201200
Self: std::future::Future + Sized,
202201
F: std::future::Future,
@@ -243,7 +242,7 @@ extension_trait! {
243242
fn try_join<F, A, B, E>(
244243
self,
245244
other: F
246-
) -> impl Future<Output = Result<(A, B), E>> [TryJoin<Self, F>]
245+
) -> [TryJoin<Self, F>]
247246
where
248247
Self: std::future::Future<Output = Result<A, E>> + Sized,
249248
F: std::future::Future<Output = Result<B, E>>,
@@ -279,7 +278,7 @@ extension_trait! {
279278
"#]
280279
#[cfg(any(all(feature = "default", feature = "unstable"), feature = "docs"))]
281280
#[cfg_attr(feature = "docs", doc(cfg(unstable)))]
282-
fn timeout(self, dur: Duration) -> impl Future<Output = Self::Output> [TimeoutFuture<Self>]
281+
fn timeout(self, dur: Duration) -> [TimeoutFuture<Self>]
283282
where Self: Sized
284283
{
285284
TimeoutFuture::new(self, dur)

src/io/buf_read/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ extension_trait! {
7878
&'a mut self,
7979
byte: u8,
8080
buf: &'a mut Vec<u8>,
81-
) -> impl Future<Output = usize> [ReadUntilFuture<'a, Self>]
81+
) -> [ReadUntilFuture<'a, Self>]
8282
where
8383
Self: Unpin,
8484
{
@@ -131,7 +131,7 @@ extension_trait! {
131131
fn read_line<'a>(
132132
&'a mut self,
133133
buf: &'a mut String,
134-
) -> impl Future<Output = io::Result<usize>> [ReadLineFuture<'a, Self>]
134+
) -> [ReadLineFuture<'a, Self>]
135135
where
136136
Self: Unpin,
137137
{

src/io/read/mod.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ extension_trait! {
6464
fn read<'a>(
6565
&'a mut self,
6666
buf: &'a mut [u8],
67-
) -> impl Future<Output = io::Result<usize>> [ReadFuture<'a, Self>]
67+
) -> [ReadFuture<'a, Self>]
6868
where
6969
Self: Unpin
7070
{
@@ -86,7 +86,7 @@ extension_trait! {
8686
fn read_vectored<'a>(
8787
&'a mut self,
8888
bufs: &'a mut [IoSliceMut<'a>],
89-
) -> impl Future<Output = io::Result<usize>> [ReadVectoredFuture<'a, Self>]
89+
) -> [ReadVectoredFuture<'a, Self>]
9090
where
9191
Self: Unpin,
9292
{
@@ -123,7 +123,7 @@ extension_trait! {
123123
fn read_to_end<'a>(
124124
&'a mut self,
125125
buf: &'a mut Vec<u8>,
126-
) -> impl Future<Output = io::Result<usize>> [ReadToEndFuture<'a, Self>]
126+
) -> [ReadToEndFuture<'a, Self>]
127127
where
128128
Self: Unpin,
129129
{
@@ -162,7 +162,7 @@ extension_trait! {
162162
fn read_to_string<'a>(
163163
&'a mut self,
164164
buf: &'a mut String,
165-
) -> impl Future<Output = io::Result<usize>> [ReadToStringFuture<'a, Self>]
165+
) -> [ReadToStringFuture<'a, Self>]
166166
where
167167
Self: Unpin,
168168
{
@@ -217,7 +217,7 @@ extension_trait! {
217217
fn read_exact<'a>(
218218
&'a mut self,
219219
buf: &'a mut [u8],
220-
) -> impl Future<Output = io::Result<()>> [ReadExactFuture<'a, Self>]
220+
) -> [ReadExactFuture<'a, Self>]
221221
where
222222
Self: Unpin,
223223
{

src/io/seek/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ extension_trait! {
4040
fn seek(
4141
&mut self,
4242
pos: SeekFrom,
43-
) -> impl Future<Output = io::Result<u64>> [SeekFuture<'_, Self>]
43+
) -> [SeekFuture<'_, Self>]
4444
where
4545
Self: Unpin,
4646
{

src/io/write/mod.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ extension_trait! {
4949
fn write<'a>(
5050
&'a mut self,
5151
buf: &'a [u8],
52-
) -> impl Future<Output = io::Result<usize>> [WriteFuture<'a, Self>]
52+
) -> [WriteFuture<'a, Self>]
5353
where
5454
Self: Unpin,
5555
{
@@ -75,7 +75,7 @@ extension_trait! {
7575
# Ok(()) }) }
7676
```
7777
"#]
78-
fn flush(&mut self) -> impl Future<Output = io::Result<()>> [FlushFuture<'_, Self>]
78+
fn flush(&mut self) -> [FlushFuture<'_, Self>]
7979
where
8080
Self: Unpin,
8181
{
@@ -97,7 +97,7 @@ extension_trait! {
9797
fn write_vectored<'a>(
9898
&'a mut self,
9999
bufs: &'a [IoSlice<'a>],
100-
) -> impl Future<Output = io::Result<usize>> [WriteVectoredFuture<'a, Self>]
100+
) -> [WriteVectoredFuture<'a, Self>]
101101
where
102102
Self: Unpin,
103103
{
@@ -133,7 +133,7 @@ extension_trait! {
133133
fn write_all<'a>(
134134
&'a mut self,
135135
buf: &'a [u8],
136-
) -> impl Future<Output = io::Result<()>> [WriteAllFuture<'a, Self>]
136+
) -> [WriteAllFuture<'a, Self>]
137137
where
138138
Self: Unpin,
139139
{
@@ -170,7 +170,7 @@ extension_trait! {
170170
fn write_fmt<'a>(
171171
&'a mut self,
172172
fmt: std::fmt::Arguments<'_>,
173-
) -> impl Future<Output = io::Result<()>> [WriteFmtFuture<'a, Self>]
173+
) -> [WriteFmtFuture<'a, Self>]
174174
where
175175
Self: Unpin,
176176
{

0 commit comments

Comments
 (0)