1
0
mirror of https://github.com/adambard/learnxinyminutes-docs.git synced 2025-08-30 18:10:20 +02:00

Merge pull request #2269 from carlomilanesi/master

Translation to Italian of Rust tutorial
This commit is contained in:
Geoff Liu
2016-08-02 13:55:53 -04:00
committed by GitHub
2 changed files with 324 additions and 2 deletions

View File

@@ -88,9 +88,10 @@ fn main() {
let s: String = "hello world".to_string();
// A string slice an immutable view into another string
// This is basically an immutable pointer to a string it doesnt
// This is basically an immutable pair of pointers to a string it doesnt
// actually contain the contents of a string, just a pointer to
// something that does (in this case, `s`)
// the begin and a pointer to the end of a string buffer,
// statically allocated or contained in another object (in this case, `s`)
let s_slice: &str = &s;
println!("{} {}", s, s_slice); // hello world hello world