Fix doctest

This commit is contained in:
John-John Tedro 2024-01-28 16:38:38 +01:00
parent 23c83fab2b
commit d63384d689
2 changed files with 4 additions and 4 deletions

View File

@ -1235,8 +1235,8 @@ impl<T: ?Sized> Rc<T> {
/// let x_ptr: *const [u32] = Rc::into_raw(x); /// let x_ptr: *const [u32] = Rc::into_raw(x);
/// ///
/// unsafe { /// unsafe {
/// let x: Rc<[u32; 3]> = Rc::from_raw(x_ptr.cast::<[u32; 3]>()) /// let x: Rc<[u32; 3]> = Rc::from_raw(x_ptr.cast::<[u32; 3]>());
/// assert_eq!(x.as_ref(), &[1, 2, 3]); /// assert_eq!(&*x, &[1, 2, 3]);
/// } /// }
/// ``` /// ```
#[inline] #[inline]

View File

@ -1381,8 +1381,8 @@ impl<T: ?Sized> Arc<T> {
/// let x_ptr: *const [u32] = Arc::into_raw(x); /// let x_ptr: *const [u32] = Arc::into_raw(x);
/// ///
/// unsafe { /// unsafe {
/// let x: Arc<[u32; 3]> = Arc::from_raw(x_ptr.cast::<[u32; 3]>()) /// let x: Arc<[u32; 3]> = Arc::from_raw(x_ptr.cast::<[u32; 3]>());
/// assert_eq!(x.as_ref(), &[1, 2, 3]); /// assert_eq!(&*x, &[1, 2, 3]);
/// } /// }
/// ``` /// ```
#[inline] #[inline]