Box::from(slice): Clarify that contents are copied
A colleague mentioned that they interpreted the old text as saying that only the pointer and the length are copied. Add a clause so it is more clear that the pointed to contents are also copied.
This commit is contained in:
parent
1673f1450e
commit
321419ec42
@ -1480,7 +1480,7 @@ impl<T: Copy> From<&[T]> for Box<[T]> {
|
||||
/// Converts a `&[T]` into a `Box<[T]>`
|
||||
///
|
||||
/// This conversion allocates on the heap
|
||||
/// and performs a copy of `slice`.
|
||||
/// and performs a copy of `slice` and its contents.
|
||||
///
|
||||
/// # Examples
|
||||
/// ```rust
|
||||
|
Loading…
x
Reference in New Issue
Block a user