From 7c902b6905724345ba850eb6cca8f8becc9a9c72 Mon Sep 17 00:00:00 2001 From: Sebastian Martinez Date: Mon, 16 Sep 2024 15:31:50 +0200 Subject: [PATCH] radicle: Add `resolves` and `labels` method to `cob::patch::Revision` To be able to query the `BTreeSet` that shows which comments are resolved by a specific revision and the `Iterator` of `Label` we require some methods to obtain them. --- radicle/src/cob/patch.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/radicle/src/cob/patch.rs b/radicle/src/cob/patch.rs index 00a67664..6425152b 100644 --- a/radicle/src/cob/patch.rs +++ b/radicle/src/cob/patch.rs @@ -1462,6 +1462,11 @@ impl Revision { &self.discussion } + /// Review comments resolved by this revision. + pub fn resolves(&self) -> &BTreeSet<(EntryId, CommentId)> { + &self.resolves + } + /// Iterate over all top-level replies. pub fn replies(&self) -> impl Iterator)> { self.discussion.comments() @@ -1654,6 +1659,11 @@ impl Review { self.comments.comments() } + /// Review labels. + pub fn labels(&self) -> impl Iterator { + self.labels.iter() + } + /// Review general comment. pub fn summary(&self) -> Option<&str> { self.summary.as_deref()