chore: Improve single letter tags

Signed-off-by: Awiteb <a@4rs.nl>
This commit is contained in:
Awiteb
2025-06-10 08:53:22 +00:00
parent 8870f8ced3
commit 2a3e2e09c0
2 changed files with 5 additions and 5 deletions

View File

@@ -17,7 +17,7 @@
use clap::Args; use clap::Args;
use nostr::{ use nostr::{
event::{Kind, TagKind}, event::{Kind, TagKind},
filter::{Alphabet, Filter}, filter::Filter,
}; };
use crate::{ use crate::{
@@ -89,7 +89,7 @@ impl CommandRunner for ViewArgs {
let mut issue_labels = utils::smart_wrap( let mut issue_labels = utils::smart_wrap(
&issue &issue
.tags .tags
.filter(TagKind::single_letter(Alphabet::T, false)) .filter(TagKind::t())
.filter_map(|t| t.content().map(|l| format!("#{l}"))) .filter_map(|t| t.content().map(|l| format!("#{l}")))
.collect::<Vec<_>>() .collect::<Vec<_>>()
.join(", "), .join(", "),

View File

@@ -24,7 +24,7 @@ use std::{
use nostr::{ use nostr::{
event::{Event, EventId, Kind, Tag, TagKind, TagStandard}, event::{Event, EventId, Kind, Tag, TagKind, TagStandard},
filter::{Alphabet, SingleLetterTag}, filter::Alphabet,
key::PublicKey, key::PublicKey,
nips::{ nips::{
nip01::Coordinate, nip01::Coordinate,
@@ -82,7 +82,7 @@ pub fn event_into_repo(event: Event, repo_id: impl Into<String>) -> GitRepositor
description: tags.map_tag(TagKind::Description, tag_value), description: tags.map_tag(TagKind::Description, tag_value),
euc: tags euc: tags
.map_marker( .map_marker(
TagKind::SingleLetter(SingleLetterTag::lowercase(Alphabet::R)), TagKind::single_letter(Alphabet::R, false),
"euc", "euc",
parse_value, parse_value,
) )
@@ -243,7 +243,7 @@ pub fn naddrs_or_file(
/// marker. /// marker.
pub fn event_reply_tag(reply_to: &EventId, relay: Option<&RelayUrl>, marker: Marker) -> Tag { pub fn event_reply_tag(reply_to: &EventId, relay: Option<&RelayUrl>, marker: Marker) -> Tag {
Tag::custom( Tag::custom(
TagKind::single_letter(Alphabet::E, false), TagKind::e(),
[ [
reply_to.to_hex(), reply_to.to_hex(),
relay.map(|r| r.to_string()).unwrap_or_default(), relay.map(|r| r.to_string()).unwrap_or_default(),