feat: add variables solutions

This commit is contained in:
zongzi531 2022-04-13 13:34:14 +08:00
parent ea912428f0
commit f27ffe540a
1 changed files with 12 additions and 0 deletions

View File

@ -42,6 +42,18 @@ fn define_x() -> String {
}
```
```rust
fn main() {
let x = define_x();
println!("{:?}, world", x);
}
fn define_x() -> &'static str {
let x = "hello";
x
}
```
5.
```rust
fn main() {