mirror of
https://github.com/Steffo99/patched-porobot.git
synced 2024-12-22 17:44:22 +00:00
Replace filter
for Some
followed by unwrap
with flatten
This commit is contained in:
parent
f549bf5fef
commit
618ebb4d50
1 changed files with 1 additions and 2 deletions
|
@ -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))
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue