From 2dde8820fa2b108db011166467f20cabb4627b69 Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Fri, 11 Mar 2022 12:27:23 +1100 Subject: [PATCH] Remove what's left of the first trait in `extension_trait`. --- src/future/future/mod.rs | 4 +--- src/io/buf_read/mod.rs | 4 +--- src/io/read/mod.rs | 4 +--- src/io/seek/mod.rs | 4 +--- src/io/write/mod.rs | 4 +--- src/stream/stream/mod.rs | 4 +--- src/utils.rs | 8 +------- 7 files changed, 7 insertions(+), 25 deletions(-) diff --git a/src/future/future/mod.rs b/src/future/future/mod.rs index d6c4d7e0..e20f8bac 100644 --- a/src/future/future/mod.rs +++ b/src/future/future/mod.rs @@ -23,14 +23,12 @@ cfg_unstable_default! { pub use core::future::Future as Future; extension_trait! { - pub trait Future {} - #[doc = r#" Extension methods for [`Future`]. [`Future`]: ../future/trait.Future.html "#] - pub trait FutureExt: core::future::Future { + pub trait FutureExt: Future { /// Returns a Future that delays execution for a specified time. /// /// # Examples diff --git a/src/io/buf_read/mod.rs b/src/io/buf_read/mod.rs index 82917156..8f248e2b 100644 --- a/src/io/buf_read/mod.rs +++ b/src/io/buf_read/mod.rs @@ -18,14 +18,12 @@ use crate::task::{Context, Poll}; pub use futures_io::AsyncBufRead as BufRead; extension_trait! { - pub trait BufRead {} - #[doc = r#" Extension methods for [`BufRead`]. [`BufRead`]: ../trait.BufRead.html "#] - pub trait BufReadExt: futures_io::AsyncBufRead { + pub trait BufReadExt: BufRead { #[doc = r#" Reads all bytes into `buf` until the delimiter `byte` or EOF is reached. diff --git a/src/io/read/mod.rs b/src/io/read/mod.rs index b8855886..f96b8154 100644 --- a/src/io/read/mod.rs +++ b/src/io/read/mod.rs @@ -24,14 +24,12 @@ pub use take::Take; pub use futures_io::AsyncRead as Read; extension_trait! { - pub trait Read {} - #[doc = r#" Extension methods for [`Read`]. [`Read`]: ../trait.Read.html "#] - pub trait ReadExt: futures_io::AsyncRead { + pub trait ReadExt: Read { #[doc = r#" Reads some bytes from the byte stream. diff --git a/src/io/seek/mod.rs b/src/io/seek/mod.rs index cafbfe62..af7cafcf 100644 --- a/src/io/seek/mod.rs +++ b/src/io/seek/mod.rs @@ -7,14 +7,12 @@ use crate::io::SeekFrom; pub use futures_io::AsyncSeek as Seek; extension_trait! { - pub trait Seek {} - #[doc = r#" Extension methods for [`Seek`]. [`Seek`]: ../trait.Seek.html "#] - pub trait SeekExt: futures_io::AsyncSeek { + pub trait SeekExt: Seek { #[doc = r#" Seeks to a new position in a byte stream. diff --git a/src/io/write/mod.rs b/src/io/write/mod.rs index 6e9a574f..b18d80f0 100644 --- a/src/io/write/mod.rs +++ b/src/io/write/mod.rs @@ -15,14 +15,12 @@ use crate::io::{self, IoSlice}; pub use futures_io::AsyncWrite as Write; extension_trait! { - pub trait Write {} - #[doc = r#" Extension methods for [`Write`]. [`Write`]: ../trait.Write.html "#] - pub trait WriteExt: futures_io::AsyncWrite { + pub trait WriteExt: Write { #[doc = r#" Writes some bytes into the byte stream. diff --git a/src/stream/stream/mod.rs b/src/stream/stream/mod.rs index 48fdbb22..0ead0800 100644 --- a/src/stream/stream/mod.rs +++ b/src/stream/stream/mod.rs @@ -146,14 +146,12 @@ cfg_unstable! { pub use futures_core::stream::Stream as Stream; extension_trait! { - pub trait Stream {} - #[doc = r#" Extension methods for [`Stream`]. [`Stream`]: ../stream/trait.Stream.html "#] - pub trait StreamExt: futures_core::stream::Stream { + pub trait StreamExt: Stream { #[doc = r#" Advances the stream and returns the next value. diff --git a/src/utils.rs b/src/utils.rs index d662e17f..96f24fd2 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -246,14 +246,8 @@ macro_rules! cfg_default { #[doc(hidden)] macro_rules! extension_trait { ( - // Interesting patterns: - // - `$name`: trait name that gets rendered in the docs - // - `$ext`: name of the hidden extension trait - // - `$base`: base trait - pub trait $name:ident {} - #[doc = $doc_ext:tt] - pub trait $ext:ident: $base:path { + pub trait $ext:ident: $name:ident { $($body_ext:tt)* } ) => {