Skip to content

Commit

Permalink
Address clippy warnings in pokemon-service (smithy-lang#2399)
Browse files Browse the repository at this point in the history
Co-authored-by: Yuki Saito <awsaito@amazon.com>
  • Loading branch information
ysaito1001 and ysaito1001 committed Feb 21, 2023
1 parent a40dbfc commit ec1a551
Showing 1 changed file with 3 additions and 4 deletions.
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 ec1a551

Please sign in to comment.