2
0
Fork 1
mirror of https://github.com/async-rs/async-std.git synced 2025-01-30 17:25:32 +00:00

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.
This commit is contained in:
Nicholas Nethercote 2022-03-11 09:31:01 +11:00
parent 8b812d553b
commit e19ab626a1
6 changed files with 27 additions and 27 deletions

View file

@ -124,7 +124,7 @@ extension_trait! {
&'a mut self, &'a mut self,
byte: u8, byte: u8,
buf: &'a mut Vec<u8>, buf: &'a mut Vec<u8>,
) -> impl Future<Output = usize> + 'a [ReadUntilFuture<'a, Self>] ) -> impl Future<Output = usize> [ReadUntilFuture<'a, Self>]
where where
Self: Unpin, Self: Unpin,
{ {
@ -177,7 +177,7 @@ extension_trait! {
fn read_line<'a>( fn read_line<'a>(
&'a mut self, &'a mut self,
buf: &'a mut String, buf: &'a mut String,
) -> impl Future<Output = io::Result<usize>> + 'a [ReadLineFuture<'a, Self>] ) -> impl Future<Output = io::Result<usize>> [ReadLineFuture<'a, Self>]
where where
Self: Unpin, Self: Unpin,
{ {

View file

@ -112,7 +112,7 @@ extension_trait! {
fn read<'a>( fn read<'a>(
&'a mut self, &'a mut self,
buf: &'a mut [u8], buf: &'a mut [u8],
) -> impl Future<Output = io::Result<usize>> + 'a [ReadFuture<'a, Self>] ) -> impl Future<Output = io::Result<usize>> [ReadFuture<'a, Self>]
where where
Self: Unpin Self: Unpin
{ {
@ -134,7 +134,7 @@ extension_trait! {
fn read_vectored<'a>( fn read_vectored<'a>(
&'a mut self, &'a mut self,
bufs: &'a mut [IoSliceMut<'a>], bufs: &'a mut [IoSliceMut<'a>],
) -> impl Future<Output = io::Result<usize>> + 'a [ReadVectoredFuture<'a, Self>] ) -> impl Future<Output = io::Result<usize>> [ReadVectoredFuture<'a, Self>]
where where
Self: Unpin, Self: Unpin,
{ {
@ -171,7 +171,7 @@ extension_trait! {
fn read_to_end<'a>( fn read_to_end<'a>(
&'a mut self, &'a mut self,
buf: &'a mut Vec<u8>, buf: &'a mut Vec<u8>,
) -> impl Future<Output = io::Result<usize>> + 'a [ReadToEndFuture<'a, Self>] ) -> impl Future<Output = io::Result<usize>> [ReadToEndFuture<'a, Self>]
where where
Self: Unpin, Self: Unpin,
{ {
@ -210,7 +210,7 @@ extension_trait! {
fn read_to_string<'a>( fn read_to_string<'a>(
&'a mut self, &'a mut self,
buf: &'a mut String, buf: &'a mut String,
) -> impl Future<Output = io::Result<usize>> + 'a [ReadToStringFuture<'a, Self>] ) -> impl Future<Output = io::Result<usize>> [ReadToStringFuture<'a, Self>]
where where
Self: Unpin, Self: Unpin,
{ {
@ -265,7 +265,7 @@ extension_trait! {
fn read_exact<'a>( fn read_exact<'a>(
&'a mut self, &'a mut self,
buf: &'a mut [u8], buf: &'a mut [u8],
) -> impl Future<Output = io::Result<()>> + 'a [ReadExactFuture<'a, Self>] ) -> impl Future<Output = io::Result<()>> [ReadExactFuture<'a, Self>]
where where
Self: Unpin, Self: Unpin,
{ {

View file

@ -76,7 +76,7 @@ extension_trait! {
fn seek( fn seek(
&mut self, &mut self,
pos: SeekFrom, pos: SeekFrom,
) -> impl Future<Output = io::Result<u64>> + '_ [SeekFuture<'_, Self>] ) -> impl Future<Output = io::Result<u64>> [SeekFuture<'_, Self>]
where where
Self: Unpin, Self: Unpin,
{ {

View file

@ -110,7 +110,7 @@ extension_trait! {
fn write<'a>( fn write<'a>(
&'a mut self, &'a mut self,
buf: &'a [u8], buf: &'a [u8],
) -> impl Future<Output = io::Result<usize>> + 'a [WriteFuture<'a, Self>] ) -> impl Future<Output = io::Result<usize>> [WriteFuture<'a, Self>]
where where
Self: Unpin, Self: Unpin,
{ {
@ -136,7 +136,7 @@ extension_trait! {
# Ok(()) }) } # Ok(()) }) }
``` ```
"#] "#]
fn flush(&mut self) -> impl Future<Output = io::Result<()>> + '_ [FlushFuture<'_, Self>] fn flush(&mut self) -> impl Future<Output = io::Result<()>> [FlushFuture<'_, Self>]
where where
Self: Unpin, Self: Unpin,
{ {
@ -158,7 +158,7 @@ extension_trait! {
fn write_vectored<'a>( fn write_vectored<'a>(
&'a mut self, &'a mut self,
bufs: &'a [IoSlice<'a>], bufs: &'a [IoSlice<'a>],
) -> impl Future<Output = io::Result<usize>> + 'a [WriteVectoredFuture<'a, Self>] ) -> impl Future<Output = io::Result<usize>> [WriteVectoredFuture<'a, Self>]
where where
Self: Unpin, Self: Unpin,
{ {
@ -194,7 +194,7 @@ extension_trait! {
fn write_all<'a>( fn write_all<'a>(
&'a mut self, &'a mut self,
buf: &'a [u8], buf: &'a [u8],
) -> impl Future<Output = io::Result<()>> + 'a [WriteAllFuture<'a, Self>] ) -> impl Future<Output = io::Result<()>> [WriteAllFuture<'a, Self>]
where where
Self: Unpin, Self: Unpin,
{ {
@ -231,7 +231,7 @@ extension_trait! {
fn write_fmt<'a>( fn write_fmt<'a>(
&'a mut self, &'a mut self,
fmt: std::fmt::Arguments<'_>, fmt: std::fmt::Arguments<'_>,
) -> impl Future<Output = io::Result<()>> + 'a [WriteFmtFuture<'a, Self>] ) -> impl Future<Output = io::Result<()>> [WriteFmtFuture<'a, Self>]
where where
Self: Unpin, Self: Unpin,
{ {

View file

@ -260,7 +260,7 @@ extension_trait! {
# }) } # }) }
``` ```
"#] "#]
fn next(&mut self) -> impl Future<Output = Option<Self::Item>> + '_ [NextFuture<'_, Self>] fn next(&mut self) -> impl Future<Output = Option<Self::Item>> [NextFuture<'_, Self>]
where where
Self: Unpin, Self: Unpin,
{ {
@ -1165,7 +1165,7 @@ extension_trait! {
fn nth( fn nth(
&mut self, &mut self,
n: usize, n: usize,
) -> impl Future<Output = Option<Self::Item>> + '_ [NthFuture<'_, Self>] ) -> impl Future<Output = Option<Self::Item>> [NthFuture<'_, Self>]
where where
Self: Unpin + Sized, Self: Unpin + Sized,
{ {
@ -1221,7 +1221,7 @@ extension_trait! {
fn all<F>( fn all<F>(
&mut self, &mut self,
f: F, f: F,
) -> impl Future<Output = bool> + '_ [AllFuture<'_, Self, F, Self::Item>] ) -> impl Future<Output = bool> [AllFuture<'_, Self, F, Self::Item>]
where where
Self: Unpin + Sized, Self: Unpin + Sized,
F: FnMut(Self::Item) -> bool, F: FnMut(Self::Item) -> bool,
@ -1270,7 +1270,7 @@ extension_trait! {
fn find<P>( fn find<P>(
&mut self, &mut self,
p: P, p: P,
) -> impl Future<Output = Option<Self::Item>> + '_ [FindFuture<'_, Self, P>] ) -> impl Future<Output = Option<Self::Item>> [FindFuture<'_, Self, P>]
where where
Self: Unpin + Sized, Self: Unpin + Sized,
P: FnMut(&Self::Item) -> bool, P: FnMut(&Self::Item) -> bool,
@ -1298,7 +1298,7 @@ extension_trait! {
fn find_map<F, B>( fn find_map<F, B>(
&mut self, &mut self,
f: F, f: F,
) -> impl Future<Output = Option<B>> + '_ [FindMapFuture<'_, Self, F>] ) -> impl Future<Output = Option<B>> [FindMapFuture<'_, Self, F>]
where where
Self: Unpin + Sized, Self: Unpin + Sized,
F: FnMut(Self::Item) -> Option<B>, F: FnMut(Self::Item) -> Option<B>,
@ -1461,7 +1461,7 @@ extension_trait! {
fn any<F>( fn any<F>(
&mut self, &mut self,
f: F, f: F,
) -> impl Future<Output = bool> + '_ [AnyFuture<'_, Self, F, Self::Item>] ) -> impl Future<Output = bool> [AnyFuture<'_, Self, F, Self::Item>]
where where
Self: Unpin + Sized, Self: Unpin + Sized,
F: FnMut(Self::Item) -> bool, F: FnMut(Self::Item) -> bool,
@ -1697,7 +1697,7 @@ extension_trait! {
&mut self, &mut self,
init: T, init: T,
f: F, f: F,
) -> impl Future<Output = Result<T, E>> + '_ [TryFoldFuture<'_, Self, F, T>] ) -> impl Future<Output = Result<T, E>> [TryFoldFuture<'_, Self, F, T>]
where where
Self: Unpin + Sized, Self: Unpin + Sized,
F: FnMut(B, Self::Item) -> Result<T, E>, F: FnMut(B, Self::Item) -> Result<T, E>,
@ -1742,7 +1742,7 @@ extension_trait! {
fn try_for_each<F, E>( fn try_for_each<F, E>(
&mut self, &mut self,
f: F, f: F,
) -> impl Future<Output = E> + 'a [TryForEachFuture<'_, Self, F>] ) -> impl Future<Output = E> [TryForEachFuture<'_, Self, F>]
where where
Self: Unpin + Sized, Self: Unpin + Sized,
F: FnMut(Self::Item) -> Result<(), E>, F: FnMut(Self::Item) -> Result<(), E>,
@ -1888,7 +1888,7 @@ extension_trait! {
#[cfg_attr(feature = "docs", doc(cfg(unstable)))] #[cfg_attr(feature = "docs", doc(cfg(unstable)))]
fn collect<'a, B>( fn collect<'a, B>(
self, self,
) -> impl Future<Output = B> + 'a [Pin<Box<dyn Future<Output = B> + 'a + Send>>] ) -> impl Future<Output = B> [Pin<Box<dyn Future<Output = B> + 'a + Send>>]
where where
Self: Sized + 'a + Send, Self: Sized + 'a + Send,
B: FromStream<Self::Item>, B: FromStream<Self::Item>,
@ -2002,7 +2002,7 @@ extension_trait! {
fn position<P>( fn position<P>(
&mut self, &mut self,
predicate: P, predicate: P,
) -> impl Future<Output = Option<usize>> + '_ [PositionFuture<'_, Self, P>] ) -> impl Future<Output = Option<usize>> [PositionFuture<'_, Self, P>]
where where
Self: Unpin + Sized, Self: Unpin + Sized,
P: FnMut(Self::Item) -> bool, P: FnMut(Self::Item) -> bool,
@ -2335,7 +2335,7 @@ extension_trait! {
#[cfg_attr(feature = "docs", doc(cfg(unstable)))] #[cfg_attr(feature = "docs", doc(cfg(unstable)))]
fn sum<'a, S>( fn sum<'a, S>(
self, self,
) -> impl Future<Output = S> + 'a [Pin<Box<dyn Future<Output = S> + 'a>>] ) -> impl Future<Output = S> [Pin<Box<dyn Future<Output = S> + 'a>>]
where where
Self: Sized + Stream<Item = S> + 'a, Self: Sized + Stream<Item = S> + 'a,
S: Sum<Self::Item>, S: Sum<Self::Item>,
@ -2381,7 +2381,7 @@ extension_trait! {
#[cfg_attr(feature = "docs", doc(cfg(unstable)))] #[cfg_attr(feature = "docs", doc(cfg(unstable)))]
fn product<'a, P>( fn product<'a, P>(
self, self,
) -> impl Future<Output = P> + 'a [Pin<Box<dyn Future<Output = P> + 'a>>] ) -> impl Future<Output = P> [Pin<Box<dyn Future<Output = P> + 'a>>]
where where
Self: Sized + Stream<Item = P> + 'a, Self: Sized + Stream<Item = P> + 'a,
P: Product, P: Product,

View file

@ -302,10 +302,10 @@ macro_rules! extension_trait {
}; };
// Parse the return type in an extension method. // Parse the return type in an extension method.
(@doc [-> impl Future<Output = $out:ty> $(+ $lt:lifetime)? [$f:ty] $($tail:tt)*] -> [$($accum:tt)*]) => { (@doc [-> impl Future<Output = $out:ty> [$f:ty] $($tail:tt)*] -> [$($accum:tt)*]) => {
extension_trait!(@doc [$($tail)*] -> [$($accum)* -> owned::ImplFuture<$out>]); extension_trait!(@doc [$($tail)*] -> [$($accum)* -> owned::ImplFuture<$out>]);
}; };
(@ext [-> impl Future<Output = $out:ty> $(+ $lt:lifetime)? [$f:ty] $($tail:tt)*] -> [$($accum:tt)*]) => { (@ext [-> impl Future<Output = $out:ty> [$f:ty] $($tail:tt)*] -> [$($accum:tt)*]) => {
extension_trait!(@ext [$($tail)*] -> [$($accum)* -> $f]); extension_trait!(@ext [$($tail)*] -> [$($accum)* -> $f]);
}; };