2024-06-22 13:14:04 +03:00
|
|
|
// TODO: Fix the compiler error in the `main` function without changing this function.
|
|
|
|
fn is_a_color_word(attempt: &str) -> bool {
|
|
|
|
attempt == "green" || attempt == "blue" || attempt == "red"
|
|
|
|
}
|
2015-09-21 01:03:00 +03:00
|
|
|
|
|
|
|
fn main() {
|
2024-06-22 13:14:04 +03:00
|
|
|
let word = String::from("green"); // Don't change this line.
|
|
|
|
|
2016-04-19 23:15:21 +03:00
|
|
|
if is_a_color_word(word) {
|
|
|
|
println!("That is a color word I know!");
|
2015-09-21 01:03:00 +03:00
|
|
|
} else {
|
2016-04-19 23:15:21 +03:00
|
|
|
println!("That is not a color word I know.");
|
2015-09-21 01:03:00 +03:00
|
|
|
}
|
|
|
|
}
|