1
Fork 0
mirror of https://github.com/Steffo99/patched-porobot.git synced 2024-12-23 01:54:22 +00:00

Use matches! macro in display_keywords

This commit is contained in:
Steffo 2023-09-13 18:31:36 +02:00
parent c321ff6b15
commit c778b5cc82
Signed by: steffo
GPG key ID: 2A24051445686895

View file

@ -138,37 +138,36 @@ fn display_subtypes(subtypes: &[CardSubtype]) -> String {
fn display_keywords(keywords: &[CardKeyword], hm: &LocalizedCardKeywordIndex) -> String { fn display_keywords(keywords: &[CardKeyword], hm: &LocalizedCardKeywordIndex) -> String {
let result = keywords let result = keywords
.iter() .iter()
.filter(|keyword| match keyword { .filter(|keyword| !matches!(keyword,
CardKeyword::Countdown => false, CardKeyword::Countdown |
CardKeyword::OnPlay => false, CardKeyword::OnPlay |
CardKeyword::Landmark => false, CardKeyword::Landmark |
CardKeyword::Shurima => false, CardKeyword::Shurima |
CardKeyword::Noxus => false, CardKeyword::Noxus |
CardKeyword::ClobberNoEmptySlotRequirement => false, CardKeyword::ClobberNoEmptySlotRequirement |
CardKeyword::Nab => false, CardKeyword::Nab |
CardKeyword::Enlightened => false, CardKeyword::Enlightened |
CardKeyword::Invoke => false, CardKeyword::Invoke |
CardKeyword::Drain => false, CardKeyword::Drain |
CardKeyword::LastBreath => false, CardKeyword::LastBreath |
CardKeyword::Demacia => false, CardKeyword::Demacia |
CardKeyword::BandleCity => false, CardKeyword::BandleCity |
CardKeyword::Bilgewater => false, CardKeyword::Bilgewater |
CardKeyword::Runeterra => false, CardKeyword::Runeterra |
CardKeyword::Recall => false, CardKeyword::Recall |
CardKeyword::Weakest => false, CardKeyword::Weakest |
CardKeyword::Support => false, CardKeyword::Support |
CardKeyword::Obliterate => false, CardKeyword::Obliterate |
CardKeyword::Imbue => false, CardKeyword::Imbue |
CardKeyword::Targon => false, CardKeyword::Targon |
CardKeyword::ShadowIsles => false, CardKeyword::ShadowIsles |
CardKeyword::AuraVisualFakeKeyword => false, CardKeyword::AuraVisualFakeKeyword |
CardKeyword::Ionia => false, CardKeyword::Ionia |
CardKeyword::PiltoverZaun => false, CardKeyword::PiltoverZaun |
CardKeyword::SilenceIndividualKeyword => false, CardKeyword::SilenceIndividualKeyword |
CardKeyword::Plunder => false, CardKeyword::Plunder |
CardKeyword::Silenced => false, CardKeyword::Silenced
_ => true, ))
})
.map(|keyword| keyword .map(|keyword| keyword
.localized(hm) .localized(hm)
.map(|o| format!("[<b>{}</b>: {}]\n", escape(&o.name), escape(&o.description))) .map(|o| format!("[<b>{}</b>: {}]\n", escape(&o.name), escape(&o.description)))