Skip to content

Instantly share code, notes, and snippets.

@levex
Created August 9, 2018 10:13
Show Gist options
  • Save levex/64d26c987bf42af73078582547989c2f to your computer and use it in GitHub Desktop.
Save levex/64d26c987bf42af73078582547989c2f to your computer and use it in GitHub Desktop.
RefCell madness
use std::cell::RefCell;
const x: RefCell<bool> = RefCell::new(false);
fn main() {
let _x = x.borrow();
if _x.clone() {
println!("True");
} else {
println!("False");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment