mirror of
https://github.com/sunface/rust-by-practice.git
synced 2025-06-23 12:39:42 +00:00
use ref
This commit is contained in:
committed by
GitHub
parent
20b8f73684
commit
94079c49af
@ -163,7 +163,7 @@ fn main() {
|
||||
let t = (String::from("hello"), String::from("world"));
|
||||
|
||||
// fill the blanks
|
||||
let (s1, s2) = t.clone();
|
||||
let (ref s1, ref s2) = t;
|
||||
|
||||
println!("{:?}, {:?}, {:?}", s1, s2, t); // -> "hello", "world", ("hello", "world")
|
||||
}
|
||||
|
Reference in New Issue
Block a user