From c249c872daba95f3f91c3a3d26c36ab040bbcd41 Mon Sep 17 00:00:00 2001 From: kageru Date: Sat, 4 Feb 2023 15:18:56 +0100 Subject: [PATCH] discard unknown sets when searching original release --- src/filter.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/filter.rs b/src/filter.rs index d4c9ccc..7e7587a 100644 --- a/src/filter.rs +++ b/src/filter.rs @@ -44,9 +44,7 @@ impl From<&Card> for SearchCard { original_year: card .card_sets .iter() - .filter_map(|s| { - SETS_BY_NAME.get(&s.set_name.to_lowercase()).unwrap_or_else(|| panic!("Set {} not found", s.set_name)).tcg_date - }) + .filter_map(|s| SETS_BY_NAME.get(&s.set_name.to_lowercase()).and_then(|s| s.tcg_date)) .map(Date::year) .min(), legal_copies: card.banlist_info.map(|bi| bi.ban_tcg).unwrap_or(BanlistStatus::Unlimited) as i32,