提交 ba032832 编写于 作者: S Simon Sapin

Doc nits

Co-Authored-By: NRalf Jung <post@ralfj.de>
上级 7a641f7c
......@@ -123,7 +123,7 @@ pub fn new(x: T) -> Box<T> {
box x
}
/// Construct a new box with uninitialized contents.
/// Constructs a new box with uninitialized contents.
///
/// # Examples
///
......@@ -161,7 +161,7 @@ pub fn pin(x: T) -> Pin<Box<T>> {
}
impl<T> Box<[T]> {
/// Construct a new boxed slice with uninitialized contents.
/// Constructs a new boxed slice with uninitialized contents.
///
/// # Examples
///
......@@ -192,7 +192,7 @@ pub fn new_uninit_slice(len: usize) -> Box<[mem::MaybeUninit<T>]> {
}
impl<T> Box<mem::MaybeUninit<T>> {
/// Convert to `Box<T>`.
/// Converts to `Box<T>`.
///
/// # Safety
///
......@@ -228,7 +228,7 @@ pub unsafe fn assume_init(self) -> Box<T> {
}
impl<T> Box<[mem::MaybeUninit<T>]> {
/// Convert to `Box<[T]>`.
/// Converts to `Box<[T]>`.
///
/// # Safety
///
......
......@@ -327,7 +327,7 @@ pub fn new(value: T) -> Rc<T> {
}))
}
/// Construct a new Rc with uninitialized contents.
/// Constructs a new `Rc` with uninitialized contents.
///
/// # Examples
///
......@@ -409,7 +409,7 @@ pub fn try_unwrap(this: Self) -> Result<T, Self> {
}
impl<T> Rc<[T]> {
/// Construct a new reference-counted slice with uninitialized contents.
/// Constructs a new reference-counted slice with uninitialized contents.
///
/// # Examples
///
......@@ -441,7 +441,7 @@ pub fn new_uninit_slice(len: usize) -> Rc<[mem::MaybeUninit<T>]> {
}
impl<T> Rc<mem::MaybeUninit<T>> {
/// Convert to `Rc<T>`.
/// Converts to `Rc<T>`.
///
/// # Safety
///
......@@ -480,7 +480,7 @@ pub unsafe fn assume_init(self) -> Rc<T> {
}
impl<T> Rc<[mem::MaybeUninit<T>]> {
/// Convert to `Rc<[T]>`.
/// Converts to `Rc<[T]>`.
///
/// # Safety
///
......@@ -721,7 +721,7 @@ pub fn get_mut(this: &mut Self) -> Option<&mut T> {
///
/// Any other `Rc` or [`Weak`] pointers to the same value must not be dereferenced
/// for the duration of the returned borrow.
/// This is trivially the case if no such pointer exist,
/// This is trivially the case if no such pointers exist,
/// for example immediately after `Rc::new`.
///
/// # Examples
......
......@@ -311,7 +311,7 @@ pub fn new(data: T) -> Arc<T> {
Self::from_inner(Box::into_raw_non_null(x))
}
/// Construct a Arc box with uninitialized contents.
/// Constructs a new `Arc` with uninitialized contents.
///
/// # Examples
///
......@@ -393,7 +393,7 @@ pub fn try_unwrap(this: Self) -> Result<T, Self> {
}
impl<T> Arc<[T]> {
/// Construct a new reference-counted slice with uninitialized contents.
/// Constructs a new reference-counted slice with uninitialized contents.
///
/// # Examples
///
......@@ -425,7 +425,7 @@ pub fn new_uninit_slice(len: usize) -> Arc<[mem::MaybeUninit<T>]> {
}
impl<T> Arc<mem::MaybeUninit<T>> {
/// Convert to `Arc<T>`.
/// Converts to `Arc<T>`.
///
/// # Safety
///
......@@ -464,7 +464,7 @@ pub unsafe fn assume_init(self) -> Arc<T> {
}
impl<T> Arc<[mem::MaybeUninit<T>]> {
/// Convert to `Arc<[T]>`.
/// Converts to `Arc<[T]>`.
///
/// # Safety
///
......@@ -1106,7 +1106,7 @@ pub fn get_mut(this: &mut Self) -> Option<&mut T> {
///
/// Any other `Arc` or [`Weak`] pointers to the same value must not be dereferenced
/// for the duration of the returned borrow.
/// This is trivially the case if no such pointer exist,
/// This is trivially the case if no such pointers exist,
/// for example immediately after `Arc::new`.
///
/// # Examples
......
......@@ -123,7 +123,7 @@ pub unsafe fn as_mut(&mut self) -> &mut T {
&mut *self.as_ptr()
}
/// Cast to a pointer of another type
/// Casts to a pointer of another type
#[inline]
pub const fn cast<U>(self) -> Unique<U> {
unsafe {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册