Skip to content

Commit e19ab62

Browse files
committed
Remove unused parameter from extension_trait! rules.
Two of the rules have `(+ $lt:lifetime)?` that is not used on the RHS and serves no useful purpose. This commit removes it.
1 parent 8b812d5 commit e19ab62

File tree

6 files changed

+27
-27
lines changed

6 files changed

+27
-27
lines changed

src/io/buf_read/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ extension_trait! {
124124
&'a mut self,
125125
byte: u8,
126126
buf: &'a mut Vec<u8>,
127-
) -> impl Future<Output = usize> + 'a [ReadUntilFuture<'a, Self>]
127+
) -> impl Future<Output = usize> [ReadUntilFuture<'a, Self>]
128128
where
129129
Self: Unpin,
130130
{
@@ -177,7 +177,7 @@ extension_trait! {
177177
fn read_line<'a>(
178178
&'a mut self,
179179
buf: &'a mut String,
180-
) -> impl Future<Output = io::Result<usize>> + 'a [ReadLineFuture<'a, Self>]
180+
) -> impl Future<Output = io::Result<usize>> [ReadLineFuture<'a, Self>]
181181
where
182182
Self: Unpin,
183183
{

src/io/read/mod.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ extension_trait! {
112112
fn read<'a>(
113113
&'a mut self,
114114
buf: &'a mut [u8],
115-
) -> impl Future<Output = io::Result<usize>> + 'a [ReadFuture<'a, Self>]
115+
) -> impl Future<Output = io::Result<usize>> [ReadFuture<'a, Self>]
116116
where
117117
Self: Unpin
118118
{
@@ -134,7 +134,7 @@ extension_trait! {
134134
fn read_vectored<'a>(
135135
&'a mut self,
136136
bufs: &'a mut [IoSliceMut<'a>],
137-
) -> impl Future<Output = io::Result<usize>> + 'a [ReadVectoredFuture<'a, Self>]
137+
) -> impl Future<Output = io::Result<usize>> [ReadVectoredFuture<'a, Self>]
138138
where
139139
Self: Unpin,
140140
{
@@ -171,7 +171,7 @@ extension_trait! {
171171
fn read_to_end<'a>(
172172
&'a mut self,
173173
buf: &'a mut Vec<u8>,
174-
) -> impl Future<Output = io::Result<usize>> + 'a [ReadToEndFuture<'a, Self>]
174+
) -> impl Future<Output = io::Result<usize>> [ReadToEndFuture<'a, Self>]
175175
where
176176
Self: Unpin,
177177
{
@@ -210,7 +210,7 @@ extension_trait! {
210210
fn read_to_string<'a>(
211211
&'a mut self,
212212
buf: &'a mut String,
213-
) -> impl Future<Output = io::Result<usize>> + 'a [ReadToStringFuture<'a, Self>]
213+
) -> impl Future<Output = io::Result<usize>> [ReadToStringFuture<'a, Self>]
214214
where
215215
Self: Unpin,
216216
{
@@ -265,7 +265,7 @@ extension_trait! {
265265
fn read_exact<'a>(
266266
&'a mut self,
267267
buf: &'a mut [u8],
268-
) -> impl Future<Output = io::Result<()>> + 'a [ReadExactFuture<'a, Self>]
268+
) -> impl Future<Output = io::Result<()>> [ReadExactFuture<'a, Self>]
269269
where
270270
Self: Unpin,
271271
{

src/io/seek/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ extension_trait! {
7676
fn seek(
7777
&mut self,
7878
pos: SeekFrom,
79-
) -> impl Future<Output = io::Result<u64>> + '_ [SeekFuture<'_, Self>]
79+
) -> impl Future<Output = io::Result<u64>> [SeekFuture<'_, Self>]
8080
where
8181
Self: Unpin,
8282
{

src/io/write/mod.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ extension_trait! {
110110
fn write<'a>(
111111
&'a mut self,
112112
buf: &'a [u8],
113-
) -> impl Future<Output = io::Result<usize>> + 'a [WriteFuture<'a, Self>]
113+
) -> impl Future<Output = io::Result<usize>> [WriteFuture<'a, Self>]
114114
where
115115
Self: Unpin,
116116
{
@@ -136,7 +136,7 @@ extension_trait! {
136136
# Ok(()) }) }
137137
```
138138
"#]
139-
fn flush(&mut self) -> impl Future<Output = io::Result<()>> + '_ [FlushFuture<'_, Self>]
139+
fn flush(&mut self) -> impl Future<Output = io::Result<()>> [FlushFuture<'_, Self>]
140140
where
141141
Self: Unpin,
142142
{
@@ -158,7 +158,7 @@ extension_trait! {
158158
fn write_vectored<'a>(
159159
&'a mut self,
160160
bufs: &'a [IoSlice<'a>],
161-
) -> impl Future<Output = io::Result<usize>> + 'a [WriteVectoredFuture<'a, Self>]
161+
) -> impl Future<Output = io::Result<usize>> [WriteVectoredFuture<'a, Self>]
162162
where
163163
Self: Unpin,
164164
{
@@ -194,7 +194,7 @@ extension_trait! {
194194
fn write_all<'a>(
195195
&'a mut self,
196196
buf: &'a [u8],
197-
) -> impl Future<Output = io::Result<()>> + 'a [WriteAllFuture<'a, Self>]
197+
) -> impl Future<Output = io::Result<()>> [WriteAllFuture<'a, Self>]
198198
where
199199
Self: Unpin,
200200
{
@@ -231,7 +231,7 @@ extension_trait! {
231231
fn write_fmt<'a>(
232232
&'a mut self,
233233
fmt: std::fmt::Arguments<'_>,
234-
) -> impl Future<Output = io::Result<()>> + 'a [WriteFmtFuture<'a, Self>]
234+
) -> impl Future<Output = io::Result<()>> [WriteFmtFuture<'a, Self>]
235235
where
236236
Self: Unpin,
237237
{

src/stream/stream/mod.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ extension_trait! {
260260
# }) }
261261
```
262262
"#]
263-
fn next(&mut self) -> impl Future<Output = Option<Self::Item>> + '_ [NextFuture<'_, Self>]
263+
fn next(&mut self) -> impl Future<Output = Option<Self::Item>> [NextFuture<'_, Self>]
264264
where
265265
Self: Unpin,
266266
{
@@ -1165,7 +1165,7 @@ extension_trait! {
11651165
fn nth(
11661166
&mut self,
11671167
n: usize,
1168-
) -> impl Future<Output = Option<Self::Item>> + '_ [NthFuture<'_, Self>]
1168+
) -> impl Future<Output = Option<Self::Item>> [NthFuture<'_, Self>]
11691169
where
11701170
Self: Unpin + Sized,
11711171
{
@@ -1221,7 +1221,7 @@ extension_trait! {
12211221
fn all<F>(
12221222
&mut self,
12231223
f: F,
1224-
) -> impl Future<Output = bool> + '_ [AllFuture<'_, Self, F, Self::Item>]
1224+
) -> impl Future<Output = bool> [AllFuture<'_, Self, F, Self::Item>]
12251225
where
12261226
Self: Unpin + Sized,
12271227
F: FnMut(Self::Item) -> bool,
@@ -1270,7 +1270,7 @@ extension_trait! {
12701270
fn find<P>(
12711271
&mut self,
12721272
p: P,
1273-
) -> impl Future<Output = Option<Self::Item>> + '_ [FindFuture<'_, Self, P>]
1273+
) -> impl Future<Output = Option<Self::Item>> [FindFuture<'_, Self, P>]
12741274
where
12751275
Self: Unpin + Sized,
12761276
P: FnMut(&Self::Item) -> bool,
@@ -1298,7 +1298,7 @@ extension_trait! {
12981298
fn find_map<F, B>(
12991299
&mut self,
13001300
f: F,
1301-
) -> impl Future<Output = Option<B>> + '_ [FindMapFuture<'_, Self, F>]
1301+
) -> impl Future<Output = Option<B>> [FindMapFuture<'_, Self, F>]
13021302
where
13031303
Self: Unpin + Sized,
13041304
F: FnMut(Self::Item) -> Option<B>,
@@ -1461,7 +1461,7 @@ extension_trait! {
14611461
fn any<F>(
14621462
&mut self,
14631463
f: F,
1464-
) -> impl Future<Output = bool> + '_ [AnyFuture<'_, Self, F, Self::Item>]
1464+
) -> impl Future<Output = bool> [AnyFuture<'_, Self, F, Self::Item>]
14651465
where
14661466
Self: Unpin + Sized,
14671467
F: FnMut(Self::Item) -> bool,
@@ -1697,7 +1697,7 @@ extension_trait! {
16971697
&mut self,
16981698
init: T,
16991699
f: F,
1700-
) -> impl Future<Output = Result<T, E>> + '_ [TryFoldFuture<'_, Self, F, T>]
1700+
) -> impl Future<Output = Result<T, E>> [TryFoldFuture<'_, Self, F, T>]
17011701
where
17021702
Self: Unpin + Sized,
17031703
F: FnMut(B, Self::Item) -> Result<T, E>,
@@ -1742,7 +1742,7 @@ extension_trait! {
17421742
fn try_for_each<F, E>(
17431743
&mut self,
17441744
f: F,
1745-
) -> impl Future<Output = E> + 'a [TryForEachFuture<'_, Self, F>]
1745+
) -> impl Future<Output = E> [TryForEachFuture<'_, Self, F>]
17461746
where
17471747
Self: Unpin + Sized,
17481748
F: FnMut(Self::Item) -> Result<(), E>,
@@ -1888,7 +1888,7 @@ extension_trait! {
18881888
#[cfg_attr(feature = "docs", doc(cfg(unstable)))]
18891889
fn collect<'a, B>(
18901890
self,
1891-
) -> impl Future<Output = B> + 'a [Pin<Box<dyn Future<Output = B> + 'a + Send>>]
1891+
) -> impl Future<Output = B> [Pin<Box<dyn Future<Output = B> + 'a + Send>>]
18921892
where
18931893
Self: Sized + 'a + Send,
18941894
B: FromStream<Self::Item>,
@@ -2002,7 +2002,7 @@ extension_trait! {
20022002
fn position<P>(
20032003
&mut self,
20042004
predicate: P,
2005-
) -> impl Future<Output = Option<usize>> + '_ [PositionFuture<'_, Self, P>]
2005+
) -> impl Future<Output = Option<usize>> [PositionFuture<'_, Self, P>]
20062006
where
20072007
Self: Unpin + Sized,
20082008
P: FnMut(Self::Item) -> bool,
@@ -2335,7 +2335,7 @@ extension_trait! {
23352335
#[cfg_attr(feature = "docs", doc(cfg(unstable)))]
23362336
fn sum<'a, S>(
23372337
self,
2338-
) -> impl Future<Output = S> + 'a [Pin<Box<dyn Future<Output = S> + 'a>>]
2338+
) -> impl Future<Output = S> [Pin<Box<dyn Future<Output = S> + 'a>>]
23392339
where
23402340
Self: Sized + Stream<Item = S> + 'a,
23412341
S: Sum<Self::Item>,
@@ -2381,7 +2381,7 @@ extension_trait! {
23812381
#[cfg_attr(feature = "docs", doc(cfg(unstable)))]
23822382
fn product<'a, P>(
23832383
self,
2384-
) -> impl Future<Output = P> + 'a [Pin<Box<dyn Future<Output = P> + 'a>>]
2384+
) -> impl Future<Output = P> [Pin<Box<dyn Future<Output = P> + 'a>>]
23852385
where
23862386
Self: Sized + Stream<Item = P> + 'a,
23872387
P: Product,

src/utils.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -302,10 +302,10 @@ macro_rules! extension_trait {
302302
};
303303

304304
// Parse the return type in an extension method.
305-
(@doc [-> impl Future<Output = $out:ty> $(+ $lt:lifetime)? [$f:ty] $($tail:tt)*] -> [$($accum:tt)*]) => {
305+
(@doc [-> impl Future<Output = $out:ty> [$f:ty] $($tail:tt)*] -> [$($accum:tt)*]) => {
306306
extension_trait!(@doc [$($tail)*] -> [$($accum)* -> owned::ImplFuture<$out>]);
307307
};
308-
(@ext [-> impl Future<Output = $out:ty> $(+ $lt:lifetime)? [$f:ty] $($tail:tt)*] -> [$($accum:tt)*]) => {
308+
(@ext [-> impl Future<Output = $out:ty> [$f:ty] $($tail:tt)*] -> [$($accum:tt)*]) => {
309309
extension_trait!(@ext [$($tail)*] -> [$($accum)* -> $f]);
310310
};
311311

0 commit comments

Comments
 (0)