Merge pull request #209 from zongzi531/master

feat: add variables solutions
This commit is contained in:
Sunface 2022-04-13 13:46:21 +08:00 committed by GitHub
commit 188762ba8f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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() {