Skip to content

Instantly share code, notes, and snippets.

@levex
Created August 9, 2018 10:13
Show Gist options
  • Select an option

  • Save levex/64d26c987bf42af73078582547989c2f to your computer and use it in GitHub Desktop.

Select an option

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");
}
}
@levex
Copy link
Author

levex commented Aug 9, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment