Skip to content

Instantly share code, notes, and snippets.

@Aaron1011
Created April 18, 2025 18:26
Show Gist options
  • Save Aaron1011/8f4f578e262d0fa3b6ca5c9745f283c8 to your computer and use it in GitHub Desktop.
Save Aaron1011/8f4f578e262d0fa3b6ca5c9745f283c8 to your computer and use it in GitHub Desktop.
use std::cell::RefCell;
struct Wrapped {
first: bool,
second: bool
}
fn main() {
let a = RefCell::new(Wrapped {
first: true,
second: true
});
let mut borrow = a.borrow_mut();
//let borrow = &mut *borrow;
let first_ref = &mut borrow.first;
let second_ref = &mut borrow.second;
first_ref;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment