lib: Expose patch and issue state from filter

This commit is contained in:
Erik Kundt
2024-03-04 23:54:17 +01:00
parent 87e64b6d0f
commit e099f20051
2 changed files with 8 additions and 0 deletions
+4
View File
@@ -63,6 +63,10 @@ impl Filter {
self
}
pub fn state(&self) -> Option<State> {
self.state.clone()
}
pub fn matches(&self, profile: &Profile, issue: &Issue) -> bool {
let matches_state = match self.state {
Some(State::Open) => matches!(issue.state(), issue::State::Open),
+4
View File
@@ -64,6 +64,10 @@ impl Filter {
self
}
pub fn state(&self) -> Option<State> {
self.state.clone()
}
pub fn matches(&self, profile: &Profile, patch: &Patch) -> bool {
let matches_state = match self.state {
Some(State::Draft) => matches!(patch.state(), patch::State::Draft),