summaryrefslogtreecommitdiff
path: root/rustlings/exercises/09_strings/strings2.rs
diff options
context:
space:
mode:
authorHunter Kvalevog <hunter@kvog.sh>2026-09-19 17:59:40 -0500
committerHunter Kvalevog <hunter@kvog.sh>2026-09-19 17:59:40 -0500
commit038b56dc102e16409823f29e483b165cd1c43178 (patch)
treea1ebc08fc4b3a07751d11b08f8f1ef95da916a9a /rustlings/exercises/09_strings/strings2.rs
parent2186d3558cb5dbe9b8712b9ad2204527b9ee70fc (diff)
rustlings: complete 09
Diffstat (limited to 'rustlings/exercises/09_strings/strings2.rs')
-rw-r--r--rustlings/exercises/09_strings/strings2.rs3
1 files changed, 1 insertions, 2 deletions
diff --git a/rustlings/exercises/09_strings/strings2.rs b/rustlings/exercises/09_strings/strings2.rs
index 93d9cb6..b03094f 100644
--- a/rustlings/exercises/09_strings/strings2.rs
+++ b/rustlings/exercises/09_strings/strings2.rs
@@ -1,4 +1,3 @@
-// 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"
}
@@ -6,7 +5,7 @@ fn is_a_color_word(attempt: &str) -> bool {
fn main() {
let word = String::from("green"); // Don't change this line.
- if is_a_color_word(word) {
+ if is_a_color_word(&word) {
println!("That is a color word I know!");
} else {
println!("That is not a color word I know.");