Rollup merge of #76534 - notriddle:doc-comments, r=jyn514
Add doc comments for From impls https://github.com/rust-lang/rust/issues/51430
This commit is contained in:
commit
17015cd5af
@ -1343,6 +1343,10 @@ impl<T: Ord> From<Vec<T>> for BinaryHeap<T> {
|
||||
|
||||
#[stable(feature = "binary_heap_extras_15", since = "1.5.0")]
|
||||
impl<T> From<BinaryHeap<T>> for Vec<T> {
|
||||
/// Converts a `BinaryHeap<T>` into a `Vec<T>`.
|
||||
///
|
||||
/// This conversion requires no data movement or allocation, and has
|
||||
/// constant time complexity.
|
||||
fn from(heap: BinaryHeap<T>) -> Vec<T> {
|
||||
heap.data
|
||||
}
|
||||
|
@ -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)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user