From 0974026a5de5150cbffa46c1cc8f7d3256b58e30 Mon Sep 17 00:00:00 2001 From: rodrimati1992 Date: Sun, 31 Jan 2021 01:37:48 -0300 Subject: [PATCH] Removed trailing whitespace --- library/core/src/mem/maybe_uninit.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/library/core/src/mem/maybe_uninit.rs b/library/core/src/mem/maybe_uninit.rs index c85b5655bdb..3be730a35ce 100644 --- a/library/core/src/mem/maybe_uninit.rs +++ b/library/core/src/mem/maybe_uninit.rs @@ -173,32 +173,32 @@ /// ## Initializing a struct field-by-field /// /// You can use `MaybeUninit`, and the [`std::ptr::addr_of_mut`] macro, to initialize structs field by field: -/// +/// /// ```rust /// use std::mem::MaybeUninit; /// use std::ptr::addr_of_mut; -/// +/// /// #[derive(Debug, PartialEq)] /// pub struct Foo { /// name: String, /// list: Vec, /// } -/// +/// /// let foo = { /// let mut uninit: MaybeUninit = MaybeUninit::uninit(); /// let ptr = uninit.as_mut_ptr(); -/// +/// /// // Initializing the `name` field /// unsafe { addr_of_mut!((*ptr).name).write("Bob".to_string()); } -/// +/// /// // Initializing the `list` field /// // If there was a panic here, then the `String` in the `name` field would be leaked. /// unsafe { addr_of_mut!((*ptr).list).write(vec![0, 1, 2]); } -/// +/// /// // All the fields are initialized, so we call `assume_init` to get an initialized Foo. /// unsafe { uninit.assume_init() } /// }; -/// +/// /// assert_eq!( /// foo, /// Foo { -- 2.44.0