according to the idea of gtm-nayan #144, add println!("Success") for each exercise

This commit is contained in:
sunface
2022-03-05 14:48:43 +08:00
parent 1000a3dc6e
commit 5394cdfcff
21 changed files with 201 additions and 13 deletions

View File

@@ -8,7 +8,9 @@
fn main() {
let x: i32; // uninitialized but using, ERROR !
let y: i32; // uninitialized but also unusing, only warning
println!("{} is equal to 5", x);
assert_eq!(x, 5);
println!("Success!")
}
```
@@ -20,7 +22,8 @@ fn main() {
let __ = 1;
__ += 2;
println!("{} is equal to 3", x);
assert_eq!(x, 3);
println!("Success!")
}
```
@@ -90,6 +93,8 @@ fn main() {
let y = 4;
// shadowing
let y = "I can also be bound to text!";
println!("Success!")
}
```
@@ -124,6 +129,8 @@ fn main() {
assert_eq!(x, 3);
assert_eq!(y, 2);
println!("Success!")
}
```
@@ -142,6 +149,8 @@ fn main() {
[.., y] = [1, 2];
// fill the blank to make the code work
assert_eq!([x,y], __);
println!("Success!")
}
```