Rename Weak::new_downgraded to Weak::new

This commit is contained in:
Sebastian Hahn 2015-12-18 22:56:29 +01:00
parent 0e043862bf
commit 4741ad38b5

View File

@ -843,13 +843,13 @@ impl<T> Weak<T> {
///
/// use std::rc::Weak;
///
/// let empty:Weak<i64> = Weak::new_downgraded();
/// let empty:Weak<i64> = Weak::new();
/// ```
#[unstable(feature = "downgraded_weak",
reason = "recently added",
issue="30425")]
pub fn new_downgraded() -> Weak<T> {
pub fn new() -> Weak<T> {
unsafe {
Weak {
_ptr: Shared::new(Box::into_raw(box RcBox {
@ -1156,8 +1156,8 @@ mod tests {
}
#[test]
fn test_new_downgraded() {
let foo: Weak<usize> = Weak::new_downgraded();
fn test_new_weak() {
let foo: Weak<usize> = Weak::new();
assert!(foo.upgrade().is_none());
}
}