diff options
author | ven <vendethiel@hotmail.fr> | 2015-06-18 09:42:41 +0200 |
---|---|---|
committer | ven <vendethiel@hotmail.fr> | 2015-06-18 09:42:41 +0200 |
commit | 20656f063118e6c6df32b5e71bedf4dc6c4dbf9e (patch) | |
tree | cf57892cae3ad5dfba0bfafd6c3033c85cf5c29e | |
parent | 68b05bcc518064dab26c5098ea369a71bb9b5d8e (diff) | |
parent | ad344ac7c68ecbfa55f5d7d50bc8b3e7c162f14b (diff) |
Merge pull request #1146 from Esption/master
Rust: Change '&*' to '&'
-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 17f7dc90..fbfa4cdf 100644 --- a/rust.html.markdown +++ b/rust.html.markdown @@ -84,7 +84,7 @@ fn main() { // This is basically an immutable pointer to a string – it doesn’t // actually contain the contents of a string, just a pointer to // something that does (in this case, `s`) - let s_slice: &str = &*s; + let s_slice: &str = &s; println!("{} {}", s, s_slice); // hello world hello world @@ -99,7 +99,7 @@ fn main() { // A slice – an immutable view into a vector or array // This is much like a string slice, but for vectors - let slice: &[i32] = &*vector; + let slice: &[i32] = &vector; // Use `{:?}` to print something debug-style println!("{:?} {:?}", vector, slice); // [1, 2, 3, 4, 5] [1, 2, 3, 4, 5] |