From d85db82960db80132a10d25e0fe7dfd5f4736d0f Mon Sep 17 00:00:00 2001 From: Michael Howell Date: Tue, 8 Sep 2020 23:38:24 -0700 Subject: [PATCH 1/2] 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 9383e7c45fa55..4e987a53b2cb2 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) } From 8b0d0a0cadbaaf0e7f4114e289a71981872c8587 Mon Sep 17 00:00:00 2001 From: Michael Howell Date: Wed, 9 Sep 2020 11:53:24 -0700 Subject: [PATCH 2/2] Add documentation for `impl From> for Vec` --- library/alloc/src/collections/binary_heap.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/library/alloc/src/collections/binary_heap.rs b/library/alloc/src/collections/binary_heap.rs index 40aa4d850f59d..24d17fdd880ba 100644 --- a/library/alloc/src/collections/binary_heap.rs +++ b/library/alloc/src/collections/binary_heap.rs @@ -1343,6 +1343,10 @@ impl From> for BinaryHeap { #[stable(feature = "binary_heap_extras_15", since = "1.5.0")] impl From> for Vec { + /// Converts a `BinaryHeap` into a `Vec`. + /// + /// This conversion requires no data movement or allocation, and has + /// constant time complexity. fn from(heap: BinaryHeap) -> Vec { heap.data }