From 2a3e2e09c037b8a4dc54ec751b561e9d1db1a70d Mon Sep 17 00:00:00 2001 From: Awiteb Date: Tue, 10 Jun 2025 08:53:22 +0000 Subject: [PATCH] chore: Improve single letter tags Signed-off-by: Awiteb --- src/cli/commands/issue/view.rs | 4 ++-- src/nostr_utils/utils.rs | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/cli/commands/issue/view.rs b/src/cli/commands/issue/view.rs index 8fd0a0c..7e3164d 100644 --- a/src/cli/commands/issue/view.rs +++ b/src/cli/commands/issue/view.rs @@ -17,7 +17,7 @@ use clap::Args; use nostr::{ event::{Kind, TagKind}, - filter::{Alphabet, Filter}, + filter::Filter, }; use crate::{ @@ -89,7 +89,7 @@ impl CommandRunner for ViewArgs { let mut issue_labels = utils::smart_wrap( &issue .tags - .filter(TagKind::single_letter(Alphabet::T, false)) + .filter(TagKind::t()) .filter_map(|t| t.content().map(|l| format!("#{l}"))) .collect::>() .join(", "), diff --git a/src/nostr_utils/utils.rs b/src/nostr_utils/utils.rs index 55378ed..16e92bb 100644 --- a/src/nostr_utils/utils.rs +++ b/src/nostr_utils/utils.rs @@ -24,7 +24,7 @@ use std::{ use nostr::{ event::{Event, EventId, Kind, Tag, TagKind, TagStandard}, - filter::{Alphabet, SingleLetterTag}, + filter::Alphabet, key::PublicKey, nips::{ nip01::Coordinate, @@ -82,7 +82,7 @@ pub fn event_into_repo(event: Event, repo_id: impl Into) -> GitRepositor description: tags.map_tag(TagKind::Description, tag_value), euc: tags .map_marker( - TagKind::SingleLetter(SingleLetterTag::lowercase(Alphabet::R)), + TagKind::single_letter(Alphabet::R, false), "euc", parse_value, ) @@ -243,7 +243,7 @@ pub fn naddrs_or_file( /// marker. pub fn event_reply_tag(reply_to: &EventId, relay: Option<&RelayUrl>, marker: Marker) -> Tag { Tag::custom( - TagKind::single_letter(Alphabet::E, false), + TagKind::e(), [ reply_to.to_hex(), relay.map(|r| r.to_string()).unwrap_or_default(),