Add a few new free functions to alloc::rc for manipulating uniquely-owned Rc values. is_unique() can be used to test if the Rc is uniquely-owned, try_unwrap() can remove the value from a uniquely-owned Rc, and get_mut() can return a &mut for a uniquely-owned Rc. These are all free functions, because smart pointers should avoid having methods when possible. They can't be static methods because UFCS will remove that distinction. I think we should probably change downgrade() and make_unique() into free functions as well, but that's out of scope. |
||
|---|---|---|
| .. | ||
| arc.rs | ||
| boxed.rs | ||
| heap.rs | ||
| lib.rs | ||
| libc_heap.rs | ||
| rc.rs | ||
| util.rs | ||