Created
April 18, 2025 18:26
-
-
Save Aaron1011/8f4f578e262d0fa3b6ca5c9745f283c8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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