From 609e2d3f8c60d960292730eead1b65212143a5e1 Mon Sep 17 00:00:00 2001 From: Juliano Penna Date: Tue, 18 Feb 2025 11:01:21 -0300 Subject: [PATCH] Add new solution in ownership ex. 9 --- solutions/ownership/ownership.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/solutions/ownership/ownership.md b/solutions/ownership/ownership.md index 1237fc0..6315083 100644 --- a/solutions/ownership/ownership.md +++ b/solutions/ownership/ownership.md @@ -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") +} +```