File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -1333,10 +1333,15 @@ impl<T: Copy> From<&[T]> for Box<[T]> {
1333
1333
impl < T : Copy > From < Cow < ' _ , [ T ] > > for Box < [ T ] > {
1334
1334
/// Converts a `Cow<'_, [T]>` into a `Box<[T]>`
1335
1335
///
1336
+ <<<<<<< HEAD
1336
1337
/// When `cow` is the `Cow::Borrowed` variant, this
1337
1338
/// conversion allocates on the heap and performs a copy of the
1338
1339
/// underlying slice. Otherwise, it will try to re-use the owned
1339
1340
/// vec's allocation.
1341
+ =======
1342
+ /// This conversion allocates on the heap
1343
+ /// and performs a copy of `s`.
1344
+ >>>>>>> Add documentation to Box conversions
1340
1345
#[ inline]
1341
1346
fn from ( cow : Cow < ' _ , [ T ] > ) -> Box < [ T ] > {
1342
1347
match cow {
@@ -1455,7 +1460,8 @@ impl<T, const N: usize> TryFrom<Box<[T]>> for Box<[T; N]> {
1455
1460
///
1456
1461
/// # Errors
1457
1462
///
1458
- /// Returns the old `Box<[T]>` in the `Err` variant if `boxed_slice.len()` does not equal `N`.
1463
+ /// Returns the old `Box<[T]>` in the `Err` variant if
1464
+ /// `boxed_slice.len()` does not equal `N`.
1459
1465
fn try_from ( boxed_slice : Box < [ T ] > ) -> Result < Self , Self :: Error > {
1460
1466
if boxed_slice. len ( ) == N {
1461
1467
Ok ( unsafe { Box :: from_raw ( Box :: into_raw ( boxed_slice) as * mut [ T ; N ] ) } )
You can’t perform that action at this time.
0 commit comments