diff options
author | Cameron Wood <github@cbwood.net> | 2015-10-13 14:07:04 -0400 |
---|---|---|
committer | Cameron Wood <github@cbwood.net> | 2015-10-13 14:07:04 -0400 |
commit | 0ac8ac899b43eb017f8582d29bf7597fb2b285b1 (patch) | |
tree | 5d77057451ac78ac9e62da316c9d6066a7969412 /rust.html.markdown | |
parent | e32eb715ef41e411da0a91b40e6e35f150a9c2eb (diff) | |
parent | 59a07411effbd0ed6289e062621deb29fe8641a8 (diff) |
Merge remote-tracking branch 'refs/remotes/adambard/master'
Diffstat (limited to 'rust.html.markdown')
-rw-r--r-- | rust.html.markdown | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/rust.html.markdown b/rust.html.markdown index b2854b0c..d0c56b4a 100644 --- a/rust.html.markdown +++ b/rust.html.markdown @@ -287,9 +287,9 @@ fn main() { // While a value is mutably borrowed, it cannot be accessed at all. let mut var2 = 4; let ref_var2: &mut i32 = &mut var2; - *ref_var2 += 2; + *ref_var2 += 2; // '*' is used to point to the mutably borrowed var2 - println!("{}", *ref_var2); // 6 + println!("{}", *ref_var2); // 6 , //var2 would not compile. //ref_var2 is of type &mut i32, so //stores a reference to an i32 not the value. // var2 = 2; // this would not compile because `var2` is borrowed } ``` |