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
commit f296908736
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 1 deletions

View File

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