@@ -72,9 +72,19 @@ pub enum IssueStatus {
|
||||
}
|
||||
|
||||
impl IssueStatus {
|
||||
/// Returns all issue statuses as kinds
|
||||
#[inline]
|
||||
pub const fn all_kinds() -> [Kind; 3] {
|
||||
[
|
||||
Self::Open.kind(),
|
||||
Self::Resolved.kind(),
|
||||
Self::Closed.kind(),
|
||||
]
|
||||
}
|
||||
|
||||
/// Maps the issue status to its corresponding Nostr kind.
|
||||
#[inline]
|
||||
pub fn kind(&self) -> Kind {
|
||||
pub const fn kind(&self) -> Kind {
|
||||
match self {
|
||||
Self::Open => Kind::GitStatusOpen,
|
||||
Self::Resolved => Kind::GitStatusApplied,
|
||||
|
||||
@@ -310,7 +310,6 @@ pub async fn list_pr_patches_and_issues<const ENTITY_TYPE: u8>(
|
||||
arc_client
|
||||
.fetch_events(filter)
|
||||
.await?
|
||||
.into_iter()
|
||||
.take(limit)
|
||||
.map(|event| {
|
||||
let c = arc_client.clone();
|
||||
@@ -527,15 +526,13 @@ pub async fn view_pr_issue<const IS_PR: bool>(
|
||||
let pr_data = if IS_PR {
|
||||
// Check if there is an update
|
||||
let pr_update = client
|
||||
.fetch_events(
|
||||
.fetch_event(
|
||||
Filter::new()
|
||||
.kind(crate::cli::pr::PR_UPDATE_KIND)
|
||||
.custom_tag(SingleLetterTag::uppercase(Alphabet::E), event.id)
|
||||
.author(event.pubkey),
|
||||
)
|
||||
.await?
|
||||
.into_iter()
|
||||
.max_by_key(|e| e.created_at.as_u64());
|
||||
.await?;
|
||||
|
||||
let commit = pr_update
|
||||
.as_ref()
|
||||
|
||||
@@ -276,16 +276,16 @@ impl PatchPrStatus {
|
||||
#[inline]
|
||||
pub const fn all_kinds() -> [Kind; 4] {
|
||||
[
|
||||
Kind::GitStatusOpen,
|
||||
Kind::GitStatusApplied,
|
||||
Kind::GitStatusClosed,
|
||||
Kind::GitStatusDraft,
|
||||
Self::Open.kind(),
|
||||
Self::MergedApplied.kind(),
|
||||
Self::Closed.kind(),
|
||||
Self::Draft.kind(),
|
||||
]
|
||||
}
|
||||
|
||||
/// Maps the patch/pr status to its corresponding Nostr kind.
|
||||
#[inline]
|
||||
pub fn kind(&self) -> Kind {
|
||||
pub const fn kind(&self) -> Kind {
|
||||
match self {
|
||||
Self::Open => Kind::GitStatusOpen,
|
||||
Self::MergedApplied => Kind::GitStatusApplied,
|
||||
|
||||
Reference in New Issue
Block a user