mirror of
https://github.com/sunface/rust-by-practice.git
synced 2025-06-23 04:29:41 +00:00
Fixed missing semicolons in basic-types, statements-expressions
This commit is contained in:
@ -27,7 +27,7 @@ fn main() {
|
|||||||
### Exercises
|
### Exercises
|
||||||
1. 🌟🌟
|
1. 🌟🌟
|
||||||
```rust,editable
|
```rust,editable
|
||||||
// make it work with two ways
|
// Make it work with two ways
|
||||||
fn main() {
|
fn main() {
|
||||||
let v = {
|
let v = {
|
||||||
let mut x = 1;
|
let mut x = 1;
|
||||||
@ -36,7 +36,7 @@ fn main() {
|
|||||||
|
|
||||||
assert_eq!(v, 3);
|
assert_eq!(v, 3);
|
||||||
|
|
||||||
println!("Success!")
|
println!("Success!");
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -48,7 +48,7 @@ fn main() {
|
|||||||
|
|
||||||
assert!(v == 3);
|
assert!(v == 3);
|
||||||
|
|
||||||
println!("Success!")
|
println!("Success!");
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -59,7 +59,7 @@ fn main() {
|
|||||||
let s = sum(1 , 2);
|
let s = sum(1 , 2);
|
||||||
assert_eq!(s, 3);
|
assert_eq!(s, 3);
|
||||||
|
|
||||||
println!("Success!")
|
println!("Success!");
|
||||||
}
|
}
|
||||||
|
|
||||||
fn sum(x: i32, y: i32) -> i32 {
|
fn sum(x: i32, y: i32) -> i32 {
|
||||||
|
Reference in New Issue
Block a user