mirror of
https://github.com/rust-lang/rustlings.git
synced 2026-05-18 11:18:44 +00:00
Explain changed line in if3 solution
This commit is contained in:
parent
db3f332507
commit
60b369a2fd
@ -2,6 +2,7 @@ fn animal_habitat(animal: &str) -> &str {
|
|||||||
let identifier = if animal == "crab" {
|
let identifier = if animal == "crab" {
|
||||||
1
|
1
|
||||||
} else if animal == "gopher" {
|
} else if animal == "gopher" {
|
||||||
|
// Integer, so that every branch has the same type.
|
||||||
2
|
2
|
||||||
} else if animal == "snake" {
|
} else if animal == "snake" {
|
||||||
3
|
3
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user