Update string.md
This commit is contained in:
parent
7e20e180a0
commit
ed09fe2082
|
@ -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)
|
||||
}
|
||||
}
|
||||
```
|
||||
```
|
||||
|
|
Loading…
Reference in New Issue