SHARE
TWEET

Untitled

a guest Oct 21st, 2019 69 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. use std::cell::RefCell;
  2.  
  3. fn main() {
  4.     let c = RefCell::new(A::B);
  5.    
  6.     let d = c.borrow();
  7.    
  8.     if let A::B = &*d {
  9.         std::mem::drop(d);
  10.  
  11.         c.replace(A::C);
  12.     }
  13. }
  14.  
  15. enum A { B, C }
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