1
Fork 0

Clarify that try_unwrap needs exactly one

Fixes #31950
This commit is contained in:
Steve Klabnik 2016-03-09 03:32:47 -05:00
parent c97524bef9
commit df550de689
2 changed files with 6 additions and 4 deletions

View file

@ -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
///
/// ```