Advertisement
Guest User

Untitled

a guest
Oct 21st, 2019
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.20 KB | None | 0 0
  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 }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement