Skip to content

Commit 321419e

Browse files
authored
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.
1 parent 1673f14 commit 321419e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

library/alloc/src/boxed.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1480,7 +1480,7 @@ impl<T: Copy> From<&[T]> for Box<[T]> {
14801480
/// Converts a `&[T]` into a `Box<[T]>`
14811481
///
14821482
/// This conversion allocates on the heap
1483-
/// and performs a copy of `slice`.
1483+
/// and performs a copy of `slice` and its contents.
14841484
///
14851485
/// # Examples
14861486
/// ```rust

0 commit comments

Comments
 (0)