Created
March 18, 2016 01:41
-
-
Save Sgeo/eaafefac1bbeef4b0550 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
extern crate take_mut; | |
let mut a = 5i32; | |
let mut b = 6i32; | |
take_mut::scope(|scope| { | |
let (a_val, a_hole) = scope.take(&mut a); | |
let (b_val, b_hole) = scope.take(&mut b); | |
b_hole.fill(a_val); | |
a_hole.fill(b_val); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment