Merge pull request #547 from msuganthan/patch-1

use ref instead of clone
This commit is contained in:
Sunface
2025-04-25 11:54:41 +08:00
committed by GitHub

View File

@ -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")
}