summaryrefslogtreecommitdiffhomepage
path: root/rust.html.markdown
diff options
context:
space:
mode:
authorAdam Heins <mail@adamheins.com>2016-06-26 06:21:27 -0700
committerven <vendethiel@hotmail.fr>2016-06-26 15:21:27 +0200
commita7015a0f8592d49f62bbafae1dcffcf1619ec92d (patch)
tree5db17fe124937af75d11e1befdc6dc6280d7d15e /rust.html.markdown
parent273fa8606b662dbec5b3b0b2fd0d3dfd648e00ab (diff)
Minor formatting and wording change in rust doc. (#2277)
Diffstat (limited to 'rust.html.markdown')
-rw-r--r--rust.html.markdown7
1 files changed, 4 insertions, 3 deletions
diff --git a/rust.html.markdown b/rust.html.markdown
index d0c56b4a..440cd9eb 100644
--- a/rust.html.markdown
+++ b/rust.html.markdown
@@ -281,7 +281,7 @@ fn main() {
println!("{}", var); // Unlike `box`, `var` can still be used
println!("{}", *ref_var);
// var = 5; // this would not compile because `var` is borrowed
- // *ref_var = 6; // this would not too, because `ref_var` is an immutable reference
+ // *ref_var = 6; // this would not either, because `ref_var` is an immutable reference
// Mutable reference
// While a value is mutably borrowed, it cannot be accessed at all.
@@ -289,8 +289,9 @@ fn main() {
let ref_var2: &mut i32 = &mut var2;
*ref_var2 += 2; // '*' is used to point to the mutably borrowed var2
- 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
+ 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.
}
```