1
Fork 0
mirror of https://github.com/Steffo99/patched-porobot.git synced 2024-10-16 09:37:27 +00:00

Replace map and flatten with filter_map

This commit is contained in:
Steffo 2023-07-03 03:10:09 +02:00
parent 96613c6626
commit 933907cd5f
Signed by: steffo
GPG key ID: 2A24051445686895

View file

@ -520,8 +520,7 @@ impl Deck {
///
pub fn cards_are_allowed_in(&self, cards: &CardIndex, format: CardFormat) -> bool {
self.contents.keys()
.map(|cc| cc.to_card(cards))
.flatten()
.filter_map(|cc| cc.to_card(cards))
.all(|c| c.formats.contains(&format))
}