daily pastebin goal
77%
SHARE
TWEET

Untitled

a guest Sep 24th, 2018 77 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. use std::rc::Rc;
  2. use std::cell::RefCell;
  3.  
  4. struct Node;
  5.  
  6. impl Node {
  7.     fn mutate(&mut self) {}
  8. }
  9.  
  10. fn foo(left: RefCell<Option<Rc<Node>>>) {
  11.     if let Some(node) = &mut *left.borrow_mut() {
  12.         Rc::get_mut(node).unwrap().mutate();
  13.     }
  14. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top