Skip to content

Commit

Permalink
Fix doc examples
Browse files Browse the repository at this point in the history
  • Loading branch information
AljoschaMeyer authored Jul 6, 2024
1 parent 8d01996 commit be23cef
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions alloc/src/boxed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -842,7 +842,7 @@ impl<T, A: Allocator> Box<[T], A> {
///
/// use std::alloc::System;
///
/// let mut values = Box::<[u32]>::try_new_uninit_slice(3, System)?;
/// let mut values = Box::<[u32]>::try_new_uninit_slice_in(3, System)?;
/// let values = unsafe {
/// // Deferred initialization:
/// values[0].as_mut_ptr().write(1);
Expand Down Expand Up @@ -885,7 +885,7 @@ impl<T, A: Allocator> Box<[T], A> {
///
/// use std::alloc::System;
///
/// let values = Box::<[u32]>::try_new_zeroed_slice(3, System)?;
/// let values = Box::<[u32]>::try_new_zeroed_slice_in(3, System)?;
/// let values = unsafe { values.assume_init() };
///
/// assert_eq!(*values, [0, 0, 0]);
Expand Down

0 comments on commit be23cef

Please sign in to comment.