diff --git a/futures-util/src/future/mod.rs b/futures-util/src/future/mod.rs index 572c90ac14..0c735023b3 100644 --- a/futures-util/src/future/mod.rs +++ b/futures-util/src/future/mod.rs @@ -535,7 +535,8 @@ pub trait FutureExt: Future { Box::pin(self) } - /// Turns a `Future` into a `TryFuture` with `Error = ()`. + /// Turns a [`Future`](Future) into a + /// [`TryFuture](futures_core::future::TryFuture). fn unit_error(self) -> UnitError where Self: Sized { diff --git a/futures-util/src/future/unit_error.rs b/futures-util/src/future/unit_error.rs index e72d742859..b473b62d0c 100644 --- a/futures-util/src/future/unit_error.rs +++ b/futures-util/src/future/unit_error.rs @@ -3,9 +3,7 @@ use futures_core::future::{FusedFuture, Future}; use futures_core::task::{Context, Poll}; use pin_utils::unsafe_pinned; -/// Future for the `unit_error` combinator, turning a `Future` into a `TryFuture`. -/// -/// This is created by the `FutureExt::unit_error` method. +/// Future for the [`unit_error`](super::FutureExt::unit_error) combinator. #[derive(Debug)] #[must_use = "futures do nothing unless polled"] pub struct UnitError { @@ -15,7 +13,6 @@ pub struct UnitError { impl UnitError { unsafe_pinned!(future: Fut); - /// Creates a new UnitError. pub(super) fn new(future: Fut) -> UnitError { UnitError { future } } diff --git a/futures/src/lib.rs b/futures/src/lib.rs index f5b0e3218e..5ad4492842 100644 --- a/futures/src/lib.rs +++ b/futures/src/lib.rs @@ -201,7 +201,7 @@ pub mod future { OptionFuture, FutureExt, - FlattenStream, Flatten, Fuse, Inspect, IntoStream, Map, Then, + FlattenStream, Flatten, Fuse, Inspect, IntoStream, Map, Then, UnitError, }; #[cfg(feature = "alloc")]