mirror of
https://github.com/async-rs/async-std.git
synced 2025-01-30 09:15:33 +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:
parent
8b812d553b
commit
e19ab626a1
6 changed files with 27 additions and 27 deletions
|
@ -124,7 +124,7 @@ extension_trait! {
|
|||
&'a mut self,
|
||||
byte: u8,
|
||||
buf: &'a mut Vec<u8>,
|
||||
) -> impl Future<Output = usize> + 'a [ReadUntilFuture<'a, Self>]
|
||||
) -> impl Future<Output = usize> [ReadUntilFuture<'a, Self>]
|
||||
where
|
||||
Self: Unpin,
|
||||
{
|
||||
|
@ -177,7 +177,7 @@ extension_trait! {
|
|||
fn read_line<'a>(
|
||||
&'a mut self,
|
||||
buf: &'a mut String,
|
||||
) -> impl Future<Output = io::Result<usize>> + 'a [ReadLineFuture<'a, Self>]
|
||||
) -> impl Future<Output = io::Result<usize>> [ReadLineFuture<'a, Self>]
|
||||
where
|
||||
Self: Unpin,
|
||||
{
|
||||
|
|
|
@ -112,7 +112,7 @@ extension_trait! {
|
|||
fn read<'a>(
|
||||
&'a mut self,
|
||||
buf: &'a mut [u8],
|
||||
) -> impl Future<Output = io::Result<usize>> + 'a [ReadFuture<'a, Self>]
|
||||
) -> impl Future<Output = io::Result<usize>> [ReadFuture<'a, Self>]
|
||||
where
|
||||
Self: Unpin
|
||||
{
|
||||
|
@ -134,7 +134,7 @@ extension_trait! {
|
|||
fn read_vectored<'a>(
|
||||
&'a mut self,
|
||||
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
|
||||
Self: Unpin,
|
||||
{
|
||||
|
@ -171,7 +171,7 @@ extension_trait! {
|
|||
fn read_to_end<'a>(
|
||||
&'a mut self,
|
||||
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
|
||||
Self: Unpin,
|
||||
{
|
||||
|
@ -210,7 +210,7 @@ extension_trait! {
|
|||
fn read_to_string<'a>(
|
||||
&'a mut self,
|
||||
buf: &'a mut String,
|
||||
) -> impl Future<Output = io::Result<usize>> + 'a [ReadToStringFuture<'a, Self>]
|
||||
) -> impl Future<Output = io::Result<usize>> [ReadToStringFuture<'a, Self>]
|
||||
where
|
||||
Self: Unpin,
|
||||
{
|
||||
|
@ -265,7 +265,7 @@ extension_trait! {
|
|||
fn read_exact<'a>(
|
||||
&'a mut self,
|
||||
buf: &'a mut [u8],
|
||||
) -> impl Future<Output = io::Result<()>> + 'a [ReadExactFuture<'a, Self>]
|
||||
) -> impl Future<Output = io::Result<()>> [ReadExactFuture<'a, Self>]
|
||||
where
|
||||
Self: Unpin,
|
||||
{
|
||||
|
|
|
@ -76,7 +76,7 @@ extension_trait! {
|
|||
fn seek(
|
||||
&mut self,
|
||||
pos: SeekFrom,
|
||||
) -> impl Future<Output = io::Result<u64>> + '_ [SeekFuture<'_, Self>]
|
||||
) -> impl Future<Output = io::Result<u64>> [SeekFuture<'_, Self>]
|
||||
where
|
||||
Self: Unpin,
|
||||
{
|
||||
|
|
|
@ -110,7 +110,7 @@ extension_trait! {
|
|||
fn write<'a>(
|
||||
&'a mut self,
|
||||
buf: &'a [u8],
|
||||
) -> impl Future<Output = io::Result<usize>> + 'a [WriteFuture<'a, Self>]
|
||||
) -> impl Future<Output = io::Result<usize>> [WriteFuture<'a, Self>]
|
||||
where
|
||||
Self: Unpin,
|
||||
{
|
||||
|
@ -136,7 +136,7 @@ extension_trait! {
|
|||
# Ok(()) }) }
|
||||
```
|
||||
"#]
|
||||
fn flush(&mut self) -> impl Future<Output = io::Result<()>> + '_ [FlushFuture<'_, Self>]
|
||||
fn flush(&mut self) -> impl Future<Output = io::Result<()>> [FlushFuture<'_, Self>]
|
||||
where
|
||||
Self: Unpin,
|
||||
{
|
||||
|
@ -158,7 +158,7 @@ extension_trait! {
|
|||
fn write_vectored<'a>(
|
||||
&'a mut self,
|
||||
bufs: &'a [IoSlice<'a>],
|
||||
) -> impl Future<Output = io::Result<usize>> + 'a [WriteVectoredFuture<'a, Self>]
|
||||
) -> impl Future<Output = io::Result<usize>> [WriteVectoredFuture<'a, Self>]
|
||||
where
|
||||
Self: Unpin,
|
||||
{
|
||||
|
@ -194,7 +194,7 @@ extension_trait! {
|
|||
fn write_all<'a>(
|
||||
&'a mut self,
|
||||
buf: &'a [u8],
|
||||
) -> impl Future<Output = io::Result<()>> + 'a [WriteAllFuture<'a, Self>]
|
||||
) -> impl Future<Output = io::Result<()>> [WriteAllFuture<'a, Self>]
|
||||
where
|
||||
Self: Unpin,
|
||||
{
|
||||
|
@ -231,7 +231,7 @@ extension_trait! {
|
|||
fn write_fmt<'a>(
|
||||
&'a mut self,
|
||||
fmt: std::fmt::Arguments<'_>,
|
||||
) -> impl Future<Output = io::Result<()>> + 'a [WriteFmtFuture<'a, Self>]
|
||||
) -> impl Future<Output = io::Result<()>> [WriteFmtFuture<'a, Self>]
|
||||
where
|
||||
Self: Unpin,
|
||||
{
|
||||
|
|
|
@ -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
|
||||
Self: Unpin,
|
||||
{
|
||||
|
@ -1165,7 +1165,7 @@ extension_trait! {
|
|||
fn nth(
|
||||
&mut self,
|
||||
n: usize,
|
||||
) -> impl Future<Output = Option<Self::Item>> + '_ [NthFuture<'_, Self>]
|
||||
) -> impl Future<Output = Option<Self::Item>> [NthFuture<'_, Self>]
|
||||
where
|
||||
Self: Unpin + Sized,
|
||||
{
|
||||
|
@ -1221,7 +1221,7 @@ extension_trait! {
|
|||
fn all<F>(
|
||||
&mut self,
|
||||
f: F,
|
||||
) -> impl Future<Output = bool> + '_ [AllFuture<'_, Self, F, Self::Item>]
|
||||
) -> impl Future<Output = bool> [AllFuture<'_, Self, F, Self::Item>]
|
||||
where
|
||||
Self: Unpin + Sized,
|
||||
F: FnMut(Self::Item) -> bool,
|
||||
|
@ -1270,7 +1270,7 @@ extension_trait! {
|
|||
fn find<P>(
|
||||
&mut self,
|
||||
p: P,
|
||||
) -> impl Future<Output = Option<Self::Item>> + '_ [FindFuture<'_, Self, P>]
|
||||
) -> impl Future<Output = Option<Self::Item>> [FindFuture<'_, Self, P>]
|
||||
where
|
||||
Self: Unpin + Sized,
|
||||
P: FnMut(&Self::Item) -> bool,
|
||||
|
@ -1298,7 +1298,7 @@ extension_trait! {
|
|||
fn find_map<F, B>(
|
||||
&mut self,
|
||||
f: F,
|
||||
) -> impl Future<Output = Option<B>> + '_ [FindMapFuture<'_, Self, F>]
|
||||
) -> impl Future<Output = Option<B>> [FindMapFuture<'_, Self, F>]
|
||||
where
|
||||
Self: Unpin + Sized,
|
||||
F: FnMut(Self::Item) -> Option<B>,
|
||||
|
@ -1461,7 +1461,7 @@ extension_trait! {
|
|||
fn any<F>(
|
||||
&mut self,
|
||||
f: F,
|
||||
) -> impl Future<Output = bool> + '_ [AnyFuture<'_, Self, F, Self::Item>]
|
||||
) -> impl Future<Output = bool> [AnyFuture<'_, Self, F, Self::Item>]
|
||||
where
|
||||
Self: Unpin + Sized,
|
||||
F: FnMut(Self::Item) -> bool,
|
||||
|
@ -1697,7 +1697,7 @@ extension_trait! {
|
|||
&mut self,
|
||||
init: T,
|
||||
f: F,
|
||||
) -> impl Future<Output = Result<T, E>> + '_ [TryFoldFuture<'_, Self, F, T>]
|
||||
) -> impl Future<Output = Result<T, E>> [TryFoldFuture<'_, Self, F, T>]
|
||||
where
|
||||
Self: Unpin + Sized,
|
||||
F: FnMut(B, Self::Item) -> Result<T, E>,
|
||||
|
@ -1742,7 +1742,7 @@ extension_trait! {
|
|||
fn try_for_each<F, E>(
|
||||
&mut self,
|
||||
f: F,
|
||||
) -> impl Future<Output = E> + 'a [TryForEachFuture<'_, Self, F>]
|
||||
) -> impl Future<Output = E> [TryForEachFuture<'_, Self, F>]
|
||||
where
|
||||
Self: Unpin + Sized,
|
||||
F: FnMut(Self::Item) -> Result<(), E>,
|
||||
|
@ -1888,7 +1888,7 @@ extension_trait! {
|
|||
#[cfg_attr(feature = "docs", doc(cfg(unstable)))]
|
||||
fn collect<'a, B>(
|
||||
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
|
||||
Self: Sized + 'a + Send,
|
||||
B: FromStream<Self::Item>,
|
||||
|
@ -2002,7 +2002,7 @@ extension_trait! {
|
|||
fn position<P>(
|
||||
&mut self,
|
||||
predicate: P,
|
||||
) -> impl Future<Output = Option<usize>> + '_ [PositionFuture<'_, Self, P>]
|
||||
) -> impl Future<Output = Option<usize>> [PositionFuture<'_, Self, P>]
|
||||
where
|
||||
Self: Unpin + Sized,
|
||||
P: FnMut(Self::Item) -> bool,
|
||||
|
@ -2335,7 +2335,7 @@ extension_trait! {
|
|||
#[cfg_attr(feature = "docs", doc(cfg(unstable)))]
|
||||
fn sum<'a, S>(
|
||||
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
|
||||
Self: Sized + Stream<Item = S> + 'a,
|
||||
S: Sum<Self::Item>,
|
||||
|
@ -2381,7 +2381,7 @@ extension_trait! {
|
|||
#[cfg_attr(feature = "docs", doc(cfg(unstable)))]
|
||||
fn product<'a, P>(
|
||||
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
|
||||
Self: Sized + Stream<Item = P> + 'a,
|
||||
P: Product,
|
||||
|
|
|
@ -302,10 +302,10 @@ macro_rules! extension_trait {
|
|||
};
|
||||
|
||||
// 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>]);
|
||||
};
|
||||
(@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]);
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue