diff --git a/src/commands/prices.rs b/src/commands/prices.rs index eac0c69..b03c5ba 100644 --- a/src/commands/prices.rs +++ b/src/commands/prices.rs @@ -86,21 +86,17 @@ async fn respond( card_result: Result>, identifier: &str, ) -> Result<()> { - match card_result? { - Some(mut card) => { - card.card_prices.retain(|_, arr| !arr.is_empty()); - if card.card_prices.is_empty() { - ctx.say(format!("Oops! `{}` is not in stock.", card.name.en)).await?; - } - else { - let embeds_map = create_embeds_map(&card); - let mut pagination = Pagination::new(ctx, &embeds_map); - pagination.start().await?; - } - } - None => { - ctx.say(format!("Could not find a card matching `{}`!", identifier)).await?; - } + let Some(mut card) = card_result? else { + ctx.say(format!("Could not find a card matching `{}`!", identifier)).await?; + return Ok(()); + }; + + card.card_prices.retain(|_, arr| !arr.is_empty()); + + if card.card_prices.is_empty() { + ctx.say(format!("Oops! `{}` is not in stock.", card.name.en)).await?; + return Ok(()); } - Ok(()) + + Pagination::new(ctx, &create_embeds_map(&card)).start().await } \ No newline at end of file