mirror of
https://github.com/rust-lang/rustlings.git
synced 2026-02-12 04:39:19 +00:00
Merge 5a3f75f2402d4752b00b6fb4551d1f540677f1e5 into 87ac600b7c050538b1622084ea7c356b8a1d02bc
This commit is contained in:
commit
2f944317c4
@ -2,6 +2,8 @@ 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" {
|
||||||
|
// all branches of an if expression must return the same type
|
||||||
|
// so we change from f64 to i32
|
||||||
2
|
2
|
||||||
} else if animal == "snake" {
|
} else if animal == "snake" {
|
||||||
3
|
3
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user