From df550de689c27803c9b8d961c747e09cca36fd3e Mon Sep 17 00:00:00 2001 From: Steve Klabnik Date: Wed, 9 Mar 2016 03:32:47 -0500 Subject: [PATCH] Clarify that try_unwrap needs exactly one Fixes #31950 --- src/liballoc/arc.rs | 5 +++-- src/liballoc/rc.rs | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/liballoc/arc.rs b/src/liballoc/arc.rs index 74325afaebd..b5d7279edb0 100644 --- a/src/liballoc/arc.rs +++ b/src/liballoc/arc.rs @@ -201,11 +201,12 @@ impl Arc { Arc { _ptr: unsafe { Shared::new(Box::into_raw(x)) } } } - /// Unwraps the contained value if the `Arc` has only one strong reference. - /// This will succeed even if there are outstanding weak references. + /// Unwraps the contained value if the `Arc` has exactly one strong reference. /// /// Otherwise, an `Err` is returned with the same `Arc`. /// + /// This will succeed even if there are outstanding weak references. + /// /// # Examples /// /// ``` diff --git a/src/liballoc/rc.rs b/src/liballoc/rc.rs index 162312e2457..dc283f5acdf 100644 --- a/src/liballoc/rc.rs +++ b/src/liballoc/rc.rs @@ -224,11 +224,12 @@ impl Rc { } } - /// Unwraps the contained value if the `Rc` has only one strong reference. - /// This will succeed even if there are outstanding weak references. + /// Unwraps the contained value if the `Rc` has exactly one strong reference. /// /// Otherwise, an `Err` is returned with the same `Rc`. /// + /// This will succeed even if there are outstanding weak references. + /// /// # Examples /// /// ```