I'm missing the vocabulary for googling this.
Is there a better way to write this? I want to filter a vector of enums to elements that match one specific pattern.
.filter(|r| match r.kind {
RoomKind::BedRoom(_) => true,
_ => false
})
#rust #dev
@h4kor https://doc.rust-lang.org/rust-by-example/flow_control/if_let.html recommends `if let` for avoiding awkward matches, but not sure how much "better" it is in this case:
```
.filter(|r| if let RoomKind::BedRoom(_) = r.kind { true } else { false })
```