From 618ebb4d501664dc6f97dc52980859500a5028fb Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Mon, 3 Jul 2023 03:07:42 +0200 Subject: [PATCH] Replace `filter` for `Some` followed by `unwrap` with `flatten` --- src/data/deckcode/deck.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/data/deckcode/deck.rs b/src/data/deckcode/deck.rs index ddca13a..6ff968e 100644 --- a/src/data/deckcode/deck.rs +++ b/src/data/deckcode/deck.rs @@ -521,8 +521,7 @@ impl Deck { pub fn cards_are_allowed_in(&self, cards: &CardIndex, format: CardFormat) -> bool { self.contents.keys() .map(|cc| cc.to_card(&cards)) - .filter(|o| o.is_some()) - .map(|o| o.unwrap()) + .flatten() .all(|c| c.formats.contains(&format)) }