Skip to content

Commit d9ab6d6

Browse files
committed
Correct doc of Vec::into_array: Returns Err(Self) instead of None
1 parent 037b621 commit d9ab6d6

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

library/alloc/src/vec/mod.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1740,10 +1740,13 @@ impl<T, A: Allocator> Vec<T, A> {
17401740
}
17411741
}
17421742

1743-
/// Converts the Vec into a boxed array. This conversion will discard any spare capacity, if there is any, see [`Vec::shrink_to_fit`].
1743+
/// Converts the Vec into a boxed array. This conversion will discard any spare capacity,
1744+
/// if there is any, see [`Vec::shrink_to_fit`].
17441745
/// If you merely wish for a reference to an array, use [`as_array`](https://doc.rust-lang.org/stable/std/primitive.slice.html#method.as_array).
17451746
///
1746-
/// If `N` is not exactly equal to [`Vec::len`], then this method returns `None`.
1747+
/// # Errors
1748+
///
1749+
/// Returns the original `Vec<T>` in the `Err` variant if [`Vec::len`] does not equal `N`.
17471750
///
17481751
/// # Examples
17491752
///

0 commit comments

Comments
 (0)