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.
This commit is contained in:
Sebastian Martinez 2024-09-16 15:31:50 +02:00 committed by cloudhead
parent 6598243465
commit 7c902b6905
No known key found for this signature in database
1 changed files with 10 additions and 0 deletions

View File

@ -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<Item = (&CommentId, &thread::Comment<CodeLocation>)> {
self.discussion.comments()
@ -1654,6 +1659,11 @@ impl Review {
self.comments.comments()
}
/// Review labels.
pub fn labels(&self) -> impl Iterator<Item = &Label> {
self.labels.iter()
}
/// Review general comment.
pub fn summary(&self) -> Option<&str> {
self.summary.as_deref()