mirror of
https://github.com/sunface/rust-by-practice.git
synced 2025-06-23 04:29:41 +00:00
Update string.md
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user