Skip to content

Commit 2dde882

Browse files
committed
Remove what's left of the first trait in extension_trait.
1 parent 1c70420 commit 2dde882

File tree

7 files changed

+7
-25
lines changed

7 files changed

+7
-25
lines changed

src/future/future/mod.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,12 @@ cfg_unstable_default! {
2323
pub use core::future::Future as Future;
2424

2525
extension_trait! {
26-
pub trait Future {}
27-
2826
#[doc = r#"
2927
Extension methods for [`Future`].
3028
3129
[`Future`]: ../future/trait.Future.html
3230
"#]
33-
pub trait FutureExt: core::future::Future {
31+
pub trait FutureExt: Future {
3432
/// Returns a Future that delays execution for a specified time.
3533
///
3634
/// # Examples

src/io/buf_read/mod.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,12 @@ use crate::task::{Context, Poll};
1818
pub use futures_io::AsyncBufRead as BufRead;
1919

2020
extension_trait! {
21-
pub trait BufRead {}
22-
2321
#[doc = r#"
2422
Extension methods for [`BufRead`].
2523
2624
[`BufRead`]: ../trait.BufRead.html
2725
"#]
28-
pub trait BufReadExt: futures_io::AsyncBufRead {
26+
pub trait BufReadExt: BufRead {
2927
#[doc = r#"
3028
Reads all bytes into `buf` until the delimiter `byte` or EOF is reached.
3129

src/io/read/mod.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,12 @@ pub use take::Take;
2424
pub use futures_io::AsyncRead as Read;
2525

2626
extension_trait! {
27-
pub trait Read {}
28-
2927
#[doc = r#"
3028
Extension methods for [`Read`].
3129
3230
[`Read`]: ../trait.Read.html
3331
"#]
34-
pub trait ReadExt: futures_io::AsyncRead {
32+
pub trait ReadExt: Read {
3533
#[doc = r#"
3634
Reads some bytes from the byte stream.
3735

src/io/seek/mod.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,12 @@ use crate::io::SeekFrom;
77
pub use futures_io::AsyncSeek as Seek;
88

99
extension_trait! {
10-
pub trait Seek {}
11-
1210
#[doc = r#"
1311
Extension methods for [`Seek`].
1412
1513
[`Seek`]: ../trait.Seek.html
1614
"#]
17-
pub trait SeekExt: futures_io::AsyncSeek {
15+
pub trait SeekExt: Seek {
1816
#[doc = r#"
1917
Seeks to a new position in a byte stream.
2018

src/io/write/mod.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,12 @@ use crate::io::{self, IoSlice};
1515
pub use futures_io::AsyncWrite as Write;
1616

1717
extension_trait! {
18-
pub trait Write {}
19-
2018
#[doc = r#"
2119
Extension methods for [`Write`].
2220
2321
[`Write`]: ../trait.Write.html
2422
"#]
25-
pub trait WriteExt: futures_io::AsyncWrite {
23+
pub trait WriteExt: Write {
2624
#[doc = r#"
2725
Writes some bytes into the byte stream.
2826

src/stream/stream/mod.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,14 +146,12 @@ cfg_unstable! {
146146
pub use futures_core::stream::Stream as Stream;
147147

148148
extension_trait! {
149-
pub trait Stream {}
150-
151149
#[doc = r#"
152150
Extension methods for [`Stream`].
153151
154152
[`Stream`]: ../stream/trait.Stream.html
155153
"#]
156-
pub trait StreamExt: futures_core::stream::Stream {
154+
pub trait StreamExt: Stream {
157155
#[doc = r#"
158156
Advances the stream and returns the next value.
159157

src/utils.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -246,14 +246,8 @@ macro_rules! cfg_default {
246246
#[doc(hidden)]
247247
macro_rules! extension_trait {
248248
(
249-
// Interesting patterns:
250-
// - `$name`: trait name that gets rendered in the docs
251-
// - `$ext`: name of the hidden extension trait
252-
// - `$base`: base trait
253-
pub trait $name:ident {}
254-
255249
#[doc = $doc_ext:tt]
256-
pub trait $ext:ident: $base:path {
250+
pub trait $ext:ident: $name:ident {
257251
$($body_ext:tt)*
258252
}
259253
) => {

0 commit comments

Comments
 (0)