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