Move the blanket `impl` outside of `extension_trait`.

pull/1006/head
Nicholas Nethercote 3 years ago
parent 6b3667d1a4
commit c626a69670

@ -285,3 +285,6 @@ extension_trait! {
}
}
}
impl<T: Future + ?Sized> FutureExt for T {}

@ -239,6 +239,8 @@ extension_trait! {
}
}
impl<T: BufRead + ?Sized> BufReadExt for T {}
pub fn read_until_internal<R: BufReadExt + ?Sized>(
mut reader: Pin<&mut R>,
cx: &mut Context<'_>,

@ -372,10 +372,11 @@ extension_trait! {
fn chain<R: Read>(self, next: R) -> Chain<Self, R> where Self: Sized {
Chain { first: self, second: next, done_first: false }
}
}
}
impl<T: Read + ?Sized> ReadExt for T {}
/// Initializes a buffer if necessary.
///
/// Currently, a buffer is always initialized because `read_initializer`

@ -48,3 +48,5 @@ extension_trait! {
}
}
}
impl<T: Seek + ?Sized> SeekExt for T {}

@ -185,3 +185,5 @@ extension_trait! {
}
}
}
impl<T: Write + ?Sized> WriteExt for T {}

@ -2307,3 +2307,6 @@ extension_trait! {
}
}
}
impl<T: Stream + ?Sized> StreamExt for T {}

@ -265,9 +265,6 @@ macro_rules! extension_trait {
pub trait $ext: $name {
extension_trait!(@ext [$($body_ext)*] -> []);
}
// Blanket implementation of the extension trait for any type implementing the base trait.
impl<T: $name + ?Sized> $ext for T {}
};
// Parse the return type in an extension method.

Loading…
Cancel
Save