mirror of
https://seed.radicle.dev/rad:z39mP9rQAaGmERfUMPULfPUi473tY.git
synced 2026-11-21 10:30:48 +08:00
lib: Expose patch and issue state from filter
This commit is contained in:
@@ -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),
|
||||
|
||||
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user