Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- use std::rc::Rc;
- use std::cell::RefCell;
- struct Node;
- impl Node {
- fn mutate(&mut self) {}
- }
- fn foo(left: RefCell<Option<Rc<Node>>>) {
- if let Some(node) = &mut *left.borrow_mut() {
- Rc::get_mut(node).unwrap().mutate();
- }
- }
Add Comment
Please, Sign In to add comment