Merge pull request #157 from Jultimate/patch-1

Update string.md
This commit is contained in:
Sunface
2022-03-16 14:14:45 +08:00
committed by GitHub

View File

@ -16,6 +16,16 @@ fn main() {
println!("{}",s) println!("{}",s)
} }
``` ```
```rust
fn main() {
let s: Box<&str> = "hello, world".into();
greetings(*s)
}
fn greetings(s: &str) {
println!("{}", s);
}
```
3. 3.
```rust ```rust
@ -171,4 +181,4 @@ fn main() {
println!("{}", c) println!("{}", c)
} }
} }
``` ```