Radish alpha
r
Radicle terminal user interface
Radicle
Git (anonymous pull)
Log in to clone via SSH
lib: Expose patch and issue state from filter
Erik Kundt committed 2 years ago
commit e099f20051f80da7cbe1ad8b10d62d01118f8e7b
parent 87e64b6d0f5a2da3d0deed8c5bf55c2ec0b3e48e
2 files changed +8 -0
modified src/common/cob/issue.rs
@@ -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),
modified src/common/cob/patch.rs
@@ -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),