Fixed typo

This commit is contained in:
CoDeus
2023-04-18 09:08:11 +02:00
committed by GitHub
parent 06b48b24b3
commit 77d68b1be3

View File

@ -37,13 +37,13 @@ fn main() {
let bird = hatch_a_bird(2); let bird = hatch_a_bird(2);
// this bird has forgotten how to swim, so below line will cause an error // this bird has forgotten how to swim, so below line will cause an error
// bird.swim(); // bird.swim();
// but it can quak // but it can quack
assert_eq!(bird.quack(), "duck duck"); assert_eq!(bird.quack(), "duck duck");
let bird = hatch_a_bird(1); let bird = hatch_a_bird(1);
// this bird has forgotten how to fly, so below line will cause an error // this bird has forgotten how to fly, so below line will cause an error
// bird.fly(); // bird.fly();
// but it can quak too // but it can quack too
assert_eq!(bird.quack(), "swan swan"); assert_eq!(bird.quack(), "swan swan");
println!("Success!") println!("Success!")
@ -95,7 +95,7 @@ fn main() {
for bird in birds { for bird in birds {
bird.quack(); bird.quack();
// when duck and swan turns into Bird, they all forgot how to fly, only remember how to quack // when duck and swan turn into Bird, they all forget how to fly, and only remember how to quack
// so, the below code will cause an error // so, the below code will cause an error
// bird.fly(); // bird.fly();
} }
@ -223,4 +223,4 @@ fn main() {
my_function(Box::new(13_u32)); my_function(Box::new(13_u32));
my_function(Box::new(String::from("abc"))); my_function(Box::new(String::from("abc")));
} }
``` ```