Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- use std::cell::RefCell;
- fn main() {
- let c = RefCell::new(A::B);
- let d = c.borrow();
- if let A::B = &*d {
- std::mem::drop(d);
- c.replace(A::C);
- }
- }
- enum A { B, C }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement