mirror of
https://github.com/sunface/rust-by-practice.git
synced 2025-06-23 20:49:41 +00:00
@ -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
|
||||||
|
Reference in New Issue
Block a user