2024-06-22 12:14:04 +02: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 00:03:00 +02:00
|
|
|
|
|
|
|
fn main() {
|
2024-06-22 12:14:04 +02:00
|
|
|
let word = String::from("green"); // Don't change this line.
|
|
|
|
|
2016-04-19 22:15:21 +02:00
|
|
|
if is_a_color_word(word) {
|
|
|
|
println!("That is a color word I know!");
|
2015-09-21 00:03:00 +02:00
|
|
|
} else {
|
2016-04-19 22:15:21 +02:00
|
|
|
println!("That is not a color word I know.");
|
2015-09-21 00:03:00 +02:00
|
|
|
}
|
|
|
|
}
|