Skip to content

Commit

Permalink
fix: use else if
Browse files Browse the repository at this point in the history
  • Loading branch information
talwat committed Aug 21, 2023
1 parent 6be1b2a commit 2a4c97e
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/sprites.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,8 @@ pub fn get_sprite(
if let Ok(pokedex_id) = pokemon.parse::<usize>() {
if pokedex_id == 0 {
*pokemon = String::from("random");
} else {
if list.len() >= pokedex_id {
*pokemon = String::from(list[pokedex_id - 1]);
}
} else if list.len() >= pokedex_id {
*pokemon = String::from(list[pokedex_id - 1]);
}
}

Expand Down

0 comments on commit 2a4c97e

Please sign in to comment.