diff --git a/solutions/compound-types/string.md b/solutions/compound-types/string.md index db02eab..2bd6c12 100644 --- a/solutions/compound-types/string.md +++ b/solutions/compound-types/string.md @@ -16,6 +16,16 @@ fn main() { println!("{}",s) } ``` +```rust +fn main() { + let s: Box<&str> = "hello, world".into(); + greetings(*s) +} + +fn greetings(s: &str) { + println!("{}", s); +} +``` 3. ```rust @@ -171,4 +181,4 @@ fn main() { println!("{}", c) } } -``` \ No newline at end of file +```