about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMichael Howell <michael@notriddle.com>2020-09-08 23:38:24 -0700
committerMichael Howell <michael@notriddle.com>2020-09-09 11:51:19 -0700
commitd85db82960db80132a10d25e0fe7dfd5f4736d0f (patch)
treefdddb7637a49e15ef18b12f7e2d3f45470c4ca0e
parent78f4cbb1efa42fff3e411fe9917f0fd2a39a9d8a (diff)
downloadrust-d85db82960db80132a10d25e0fe7dfd5f4736d0f.tar.gz
rust-d85db82960db80132a10d25e0fe7dfd5f4736d0f.zip
Add documentation for `impl<T> From<T> for Poll<T>`
-rw-r--r--library/core/src/task/poll.rs8
1 files changed, 8 insertions, 0 deletions
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<T, E> Poll<Option<Result<T, E>>> {
 
 #[stable(feature = "futures_api", since = "1.36.0")]
 impl<T> From<T> for Poll<T> {
+    /// Convert to a `Ready` variant.
+    ///
+    /// # Example
+    ///
+    /// ```
+    /// # use core::task::Poll;
+    /// assert_eq!(Poll::from(true), Poll::Ready(true));
+    /// ```
     fn from(t: T) -> Poll<T> {
         Poll::Ready(t)
     }