Rollup merge of #32147 - steveklabnik:gh31950, r=bluss
Clarify that try_unwrap needs exactly one Fixes #31950
This commit is contained in:
commit
76bcf6430f
2 changed files with 6 additions and 4 deletions
|
@ -201,11 +201,12 @@ impl<T> Arc<T> {
|
|||
Arc { _ptr: unsafe { Shared::new(Box::into_raw(x)) } }
|
||||
}
|
||||
|
||||
/// Unwraps the contained value if the `Arc<T>` has only one strong reference.
|
||||
/// This will succeed even if there are outstanding weak references.
|
||||
/// Unwraps the contained value if the `Arc<T>` has exactly one strong reference.
|
||||
///
|
||||
/// Otherwise, an `Err` is returned with the same `Arc<T>`.
|
||||
///
|
||||
/// This will succeed even if there are outstanding weak references.
|
||||
///
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
|
|
|
@ -224,11 +224,12 @@ impl<T> Rc<T> {
|
|||
}
|
||||
}
|
||||
|
||||
/// Unwraps the contained value if the `Rc<T>` has only one strong reference.
|
||||
/// This will succeed even if there are outstanding weak references.
|
||||
/// Unwraps the contained value if the `Rc<T>` has exactly one strong reference.
|
||||
///
|
||||
/// Otherwise, an `Err` is returned with the same `Rc<T>`.
|
||||
///
|
||||
/// This will succeed even if there are outstanding weak references.
|
||||
///
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue