diff options
| author | Steve Klabnik <steve@steveklabnik.com> | 2016-03-09 03:32:47 -0500 |
|---|---|---|
| committer | Steve Klabnik <steve@steveklabnik.com> | 2016-03-09 03:33:51 -0500 |
| commit | df550de689c27803c9b8d961c747e09cca36fd3e (patch) | |
| tree | 0f37c4055e8a132822757d8c59e41e2cb3746c3c /src/liballoc | |
| parent | c97524bef9e59a80875110b402b3fc8c139d4d64 (diff) | |
| download | rust-df550de689c27803c9b8d961c747e09cca36fd3e.tar.gz rust-df550de689c27803c9b8d961c747e09cca36fd3e.zip | |
Clarify that try_unwrap needs exactly one
Fixes #31950
Diffstat (limited to 'src/liballoc')
| -rw-r--r-- | src/liballoc/arc.rs | 5 | ||||
| -rw-r--r-- | 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<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 /// /// ``` 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<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 /// /// ``` |
