mirror of
https://github.com/rust-lang/rustlings.git
synced 2025-12-28 06:49:19 +00:00
Merge 5a30006f46a01ea295c64a584600818f6111c8ec into 7850a73d95c02840f4ab3bf8d9571b08410e5467
This commit is contained in:
commit
f2871b2785
@ -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…
x
Reference in New Issue
Block a user