Skip to content

Commit

Permalink
Address clippy warnings in pokemon-service (#2399)
Browse files Browse the repository at this point in the history
Co-authored-by: Yuki Saito <awsaito@amazon.com>
  • Loading branch information
2 people authored and Velfi committed Feb 23, 2023
1 parent 0dc2958 commit 9796bb9
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,8 @@ pub async fn capture_pokemon(
Some(event) => {
let capturing_event = event.as_event();
if let Ok(attempt) = capturing_event {
let payload = attempt.payload.clone().unwrap_or(CapturingPayload::builder().build());
let pokeball = payload.pokeball.as_ref().map(|ball| ball.as_str()).unwrap_or("");
let payload = attempt.payload.clone().unwrap_or_else(|| CapturingPayload::builder().build());
let pokeball = payload.pokeball.as_deref().unwrap_or("");
if ! matches!(pokeball, "Master Ball" | "Great Ball" | "Fast Ball") {
yield Err(
crate::error::CapturePokemonEventsError::InvalidPokeballError(
Expand All @@ -250,8 +250,7 @@ pub async fn capture_pokemon(
let shiny = rand::thread_rng().gen_range(0..4096) == 0;
let pokemon = payload
.name
.as_ref()
.map(|name| name.as_str())
.as_deref()
.unwrap_or("")
.to_string();
let pokedex: Vec<u8> = (0..255).collect();
Expand Down

0 comments on commit 9796bb9

Please sign in to comment.