Merge pull request #546 from jpenna/patch-3

Add new solution in ownership ex. 9
This commit is contained in:
Sunface
2025-04-25 11:55:42 +08:00
committed by GitHub

View File

@ -168,3 +168,14 @@ fn main() {
println!("{:?}, {:?}, {:?}", s1, s2, t); // -> "hello", "world", ("hello", "world")
}
```
```rust
fn main() {
let t = (String::from("hello"), String::from("world"));
// fill the blanks
let (ref s1, ref s2) = t;
println!("{:?}, {:?}, {:?}", s1, s2, t); // -> "hello", "world", ("hello", "world")
}
```