Open
Description
When I was doing rustlings, I got confused in the comment of this code. I will put here the whole rustling since it is not big:
// 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"
}
fn main() {
let word = String::from("green"); // Don't change this line.
if is_a_color_word(word) {
println!("That is a color word I know!");
} else {
println!("That is not a color word I know.");
}
}
Main confusion cause
is the word this
. At first I thought that this might relate to main function because it goes right after it being mentioned in the sentence, then I thought that it might mean function that is directly below.
I believe it is possible to completely eliminate the confusion.
Suggestion:
- replace
this
with the actual name of the funcitonis_a_color_word
the whole comment would then look like:
// TODO: Fix the compiler error in the `main` function without changing `is_a_color_word` function.
Metadata
Metadata
Assignees
Labels
No labels