Skip to content

Commit df550de

Browse files
committedMar 9, 2016
Clarify that try_unwrap needs exactly one
Fixes #31950
1 parent c97524b commit df550de

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed
 

‎src/liballoc/arc.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -201,11 +201,12 @@ impl<T> Arc<T> {
201201
Arc { _ptr: unsafe { Shared::new(Box::into_raw(x)) } }
202202
}
203203

204-
/// Unwraps the contained value if the `Arc<T>` has only one strong reference.
205-
/// This will succeed even if there are outstanding weak references.
204+
/// Unwraps the contained value if the `Arc<T>` has exactly one strong reference.
206205
///
207206
/// Otherwise, an `Err` is returned with the same `Arc<T>`.
208207
///
208+
/// This will succeed even if there are outstanding weak references.
209+
///
209210
/// # Examples
210211
///
211212
/// ```

‎src/liballoc/rc.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -224,11 +224,12 @@ impl<T> Rc<T> {
224224
}
225225
}
226226

227-
/// Unwraps the contained value if the `Rc<T>` has only one strong reference.
228-
/// This will succeed even if there are outstanding weak references.
227+
/// Unwraps the contained value if the `Rc<T>` has exactly one strong reference.
229228
///
230229
/// Otherwise, an `Err` is returned with the same `Rc<T>`.
231230
///
231+
/// This will succeed even if there are outstanding weak references.
232+
///
232233
/// # Examples
233234
///
234235
/// ```

0 commit comments

Comments
 (0)
Please sign in to comment.