mirror of
https://github.com/rust-lang/rustlings.git
synced 2025-04-01 05:45:20 +01:00
Merge 5a30006f46
into 7c0d269279
This commit is contained in:
commit
dafc7e701c
1 changed files with 2 additions and 0 deletions
|
@ -2,6 +2,8 @@ fn animal_habitat(animal: &str) -> &str {
|
|||
let identifier = if animal == "crab" {
|
||||
1
|
||||
} else if animal == "gopher" {
|
||||
// all branches of an if expression must return the same type
|
||||
// so we change from f64 to i32
|
||||
2
|
||||
} else if animal == "snake" {
|
||||
3
|
||||
|
|
Loading…
Reference in a new issue