From d85db82960db80132a10d25e0fe7dfd5f4736d0f Mon Sep 17 00:00:00 2001 From: Michael Howell Date: Tue, 8 Sep 2020 23:38:24 -0700 Subject: [PATCH] Add documentation for `impl From for Poll` --- library/core/src/task/poll.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/library/core/src/task/poll.rs b/library/core/src/task/poll.rs index 9383e7c45fa..4e987a53b2c 100644 --- a/library/core/src/task/poll.rs +++ b/library/core/src/task/poll.rs @@ -112,6 +112,14 @@ impl Poll>> { #[stable(feature = "futures_api", since = "1.36.0")] impl From for Poll { + /// Convert to a `Ready` variant. + /// + /// # Example + /// + /// ``` + /// # use core::task::Poll; + /// assert_eq!(Poll::from(true), Poll::Ready(true)); + /// ``` fn from(t: T) -> Poll { Poll::Ready(t) }