mirror of
https://github.com/sunface/rust-by-practice.git
synced 2025-06-25 05:29:41 +00:00
@ -117,7 +117,7 @@ fn main() {
|
||||
}
|
||||
};
|
||||
|
||||
println!("Excercise Failed if printing out this line!");
|
||||
println!("Exercise Failed if printing out this line!");
|
||||
}
|
||||
|
||||
```
|
@ -246,7 +246,7 @@ fn main() {
|
||||
|
||||
```rust
|
||||
/* Fill in the blank and fix the errror */
|
||||
// You can aslo use `impl FnOnce(i32) -> i32`
|
||||
// You can also use `impl FnOnce(i32) -> i32`
|
||||
fn create_fn() -> impl Fn(i32) -> i32 {
|
||||
let num = 5;
|
||||
|
||||
|
@ -95,7 +95,7 @@ fn main() {
|
||||
|
||||
for bird in birds {
|
||||
bird.quack();
|
||||
// when duck and swan turns into Bird, they all forgot how to fly, only remeber how to quack
|
||||
// when duck and swan turns into Bird, they all forgot how to fly, only remember how to quack
|
||||
// so, the below code will cause an error
|
||||
// bird.fly();
|
||||
}
|
||||
|
@ -10,13 +10,13 @@ fn drink(beverage: &str) {
|
||||
panic!("drinked, duang.....peng!")
|
||||
}
|
||||
|
||||
println!("Excercise Failed if printing out this line!");
|
||||
println!("Exercise Failed if printing out this line!");
|
||||
}
|
||||
|
||||
fn main() {
|
||||
drink("lemonade");
|
||||
|
||||
println!("Excercise Failed if printing out this line!");
|
||||
println!("Exercise Failed if printing out this line!");
|
||||
}
|
||||
```
|
||||
|
||||
|
Reference in New Issue
Block a user