Skip to content

Commit 7444716

Browse files
taiki-eNemo157
authored andcommitted
Unify the style of combinator type descriptions
1 parent d87e0ec commit 7444716

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+97
-325
lines changed

futures-util/src/future/catch_unwind.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@ use std::pin::Pin;
66
use std::panic::{catch_unwind, UnwindSafe, AssertUnwindSafe};
77
use std::prelude::v1::*;
88

9-
/// Future for the `catch_unwind` combinator.
10-
///
11-
/// This is created by the `Future::catch_unwind` method.
9+
/// Future for the [`catch_unwind`](super::FutureExt::catch_unwind) combinator.
1210
#[derive(Debug)]
1311
#[must_use = "futures do nothing unless polled"]
1412
pub struct CatchUnwind<Fut> where Fut: Future {

futures-util/src/future/disabled/select.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,7 @@ use futures_core::task;
33

44
use either::Either;
55

6-
/// Future for the `select` combinator, waiting for one of two differently-typed
7-
/// futures to complete.
8-
///
9-
/// This is created by the [`Future::select`] method.
10-
///
11-
/// [`Future::select`]: trait.Future.html#method.select
6+
/// Future for the [`select`](super::FutureExt::select) combinator.
127
#[must_use = "futures do nothing unless polled"]
138
#[derive(Debug)]
149
pub struct Select<A, B> {

futures-util/src/future/disabled/select_all.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,7 @@ use std::prelude::v1::*;
77
use futures_core::{Future, IntoFuture, Poll, Async};
88
use futures_core::task;
99

10-
/// Future for the `select_all` combinator, waiting for one of any of a list of
11-
/// futures to complete.
12-
///
13-
/// This is created by the `select_all` function.
10+
/// Future for the [`select_all`] combinator.
1411
#[derive(Debug)]
1512
#[must_use = "futures do nothing unless polled"]
1613
pub struct SelectAll<A> where A: Future {

futures-util/src/future/disabled/select_ok.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,7 @@ use std::prelude::v1::*;
77
use futures_core::{Future, IntoFuture, Poll, Async};
88
use futures_core::task;
99

10-
/// Future for the `select_ok` combinator, waiting for one of any of a list of
11-
/// futures to successfully complete. Unlike `select_all`, this future ignores all
12-
/// but the last error, if there are any.
13-
///
14-
/// This is created by the `select_ok` function.
10+
/// Future for the [`select_ok`] combinator.
1511
#[derive(Debug)]
1612
#[must_use = "futures do nothing unless polled"]
1713
pub struct SelectOk<A> where A: Future {

futures-util/src/future/empty.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@ use core::pin::Pin;
33
use futures_core::future::{Future, FusedFuture};
44
use futures_core::task::{Waker, Poll};
55

6-
/// A future which is never resolved.
7-
///
8-
/// This future can be created with the [`empty()`] function.
6+
/// Future for the [`empty`] combinator.
97
#[derive(Debug)]
108
#[must_use = "futures do nothing unless polled"]
119
pub struct Empty<T> {

futures-util/src/future/flatten.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,7 @@ use futures_core::future::{FusedFuture, Future};
55
use futures_core::task::{Waker, Poll};
66
use pin_utils::unsafe_pinned;
77

8-
/// Future for the `flatten` combinator.
9-
///
10-
/// This combinator turns a `Future`-of-a-`Future` into a single `Future`.
11-
///
12-
/// This is created by the `Future::flatten` method.
8+
/// Future for the [`flatten`](super::FutureExt::flatten) combinator.
139
#[must_use = "futures do nothing unless polled"]
1410
pub struct Flatten<Fut>
1511
where Fut: Future,

futures-util/src/future/flatten_stream.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,8 @@ use futures_core::future::Future;
44
use futures_core::stream::{FusedStream, Stream};
55
use futures_core::task::{Waker, Poll};
66

7-
/// Future for the `flatten_stream` combinator, flattening a
8-
/// future-of-a-stream to get just the result of the final stream as a stream.
9-
///
10-
/// This is created by the `Future::flatten_stream` method.
7+
/// Stream for the [`flatten_stream`](super::FutureExt::flatten_stream)
8+
/// combinator.
119
#[must_use = "streams do nothing unless polled"]
1210
pub struct FlattenStream<Fut: Future> {
1311
state: State<Fut>

futures-util/src/future/fuse.rs

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,7 @@ use futures_core::future::{Future, FusedFuture};
33
use futures_core::task::{Waker, Poll};
44
use pin_utils::unsafe_pinned;
55

6-
/// A future which "fuses" a future once it has been resolved.
7-
/// This wrapper can be used to turn any `Future` into a `FusedFuture`.
8-
///
9-
/// Normally, `poll`ing a future after it has completed (returned `Poll::Ready`
10-
/// from a call to `poll`) can cause arbitrary behavior (panics, deadlock).
11-
/// `Fuse` is always defined to return `Poll::Pending` from `poll` after it has
12-
/// resolved.
13-
///
14-
/// This is created by the `Future::fuse` method.
6+
/// Future for the [`fuse`](super::FutureExt::fuse) combinator.
157
#[derive(Debug)]
168
#[must_use = "futures do nothing unless polled"]
179
pub struct Fuse<Fut: Future> {

futures-util/src/future/inspect.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@ use futures_core::future::{FusedFuture, Future};
33
use futures_core::task::{Waker, Poll};
44
use pin_utils::{unsafe_pinned, unsafe_unpinned};
55

6-
/// Do something with the item of a future, passing it on.
7-
///
8-
/// This is created by the [`super::FutureExt::inspect`] method.
6+
/// Future for the [`inspect`](super::FutureExt::inspect) combinator.
97
#[derive(Debug)]
108
#[must_use = "futures do nothing unless polled"]
119
pub struct Inspect<Fut, F> where Fut: Future {

futures-util/src/future/into_stream.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ use futures_core::stream::Stream;
44
use futures_core::task::{Waker, Poll};
55
use pin_utils::unsafe_pinned;
66

7-
/// A type which converts a `Future` into a `Stream`
8-
/// containing a single element.
7+
/// Stream for the [`into_stream`](super::FutureExt::into_stream) combinator.
98
#[must_use = "futures do nothing unless polled"]
109
#[derive(Debug)]
1110
pub struct IntoStream<Fut: Future> {

0 commit comments

Comments
 (0)