mirror of
https://github.com/Steffo99/patched-porobot.git
synced 2024-12-23 01:54: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 {
|
pub fn cards_are_allowed_in(&self, cards: &CardIndex, format: CardFormat) -> bool {
|
||||||
self.contents.keys()
|
self.contents.keys()
|
||||||
.map(|cc| cc.to_card(&cards))
|
.map(|cc| cc.to_card(&cards))
|
||||||
.filter(|o| o.is_some())
|
.flatten()
|
||||||
.map(|o| o.unwrap())
|
|
||||||
.all(|c| c.formats.contains(&format))
|
.all(|c| c.formats.contains(&format))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue