Add new solution in ownership ex. 9

This commit is contained in:
Juliano Penna
2025-02-18 11:01:21 -03:00
committed by GitHub
parent 20b8f73684
commit 609e2d3f8c

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