Created
August 9, 2018 10:13
-
-
Save levex/64d26c987bf42af73078582547989c2f to your computer and use it in GitHub Desktop.
RefCell madness
This file contains 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; | |
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
http://play.rust-lang.org/?gist=deac072456aca21ef04804ab706baf5a&version=stable&mode=debug&edition=2015