Last active
November 14, 2016 17:40
-
-
Save stat/d503c2f7f27b4b9159b29c163930c091 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
fn add_to_mutable_reference(x: &mut i32) { | |
*x +=1; | |
} | |
#[test] | |
fn mutable_reference_test() { | |
let mut x = 5; | |
mutable_reference(&mut x); | |
assert_eq!(6, x); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment