summaryrefslogtreecommitdiff
path: root/rustlings/exercises/03_if/if3.rs
diff options
context:
space:
mode:
authorHunter Kvalevog <hunter@kvog.sh>2026-09-18 16:12:53 -0500
committerHunter Kvalevog <hunter@kvog.sh>2026-09-18 16:22:39 -0500
commit84c3c20d440f724cc08b8ef80e16379e84c64cdf (patch)
treec6745162467dc6245044cd1d6a55140e34eefdc5 /rustlings/exercises/03_if/if3.rs
parent226a48c93ad9ce05ae7b3075d5b4258eedef8d6e (diff)
rustlings: complete 03
Diffstat (limited to 'rustlings/exercises/03_if/if3.rs')
-rw-r--r--rustlings/exercises/03_if/if3.rs5
1 files changed, 2 insertions, 3 deletions
diff --git a/rustlings/exercises/03_if/if3.rs b/rustlings/exercises/03_if/if3.rs
index 89164eb..fee96f8 100644
--- a/rustlings/exercises/03_if/if3.rs
+++ b/rustlings/exercises/03_if/if3.rs
@@ -1,13 +1,12 @@
fn animal_habitat(animal: &str) -> &str {
- // TODO: Fix the compiler error in the statement below.
let identifier = if animal == "crab" {
1
} else if animal == "gopher" {
- 2.0
+ 2
} else if animal == "snake" {
3
} else {
- "Unknown"
+ 0
};
// Don't change the expression below!