Skip to content

Commit

Permalink
nostr: add TagKind::k constructor
Browse files Browse the repository at this point in the history
Closes rust-nostr#674

Signed-off-by: Yuki Kishimoto <[email protected]>
  • Loading branch information
yukibtc committed Dec 12, 2024
1 parent ed6539b commit 1baac8a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@

* nostr: add `Tags::challenge` method ([Yuki Kishimoto])
* nostr: add `RelayUrl::is_local_addr` ([Yuki Kishimoto])
* nostr: add `TagKind::k` constructor ([Yuki Kishimoto])
* database: impl PartialEq and Eq for `Events` ([Yuki Kishimoto])
* database: add `SaveEventStatus` enum ([Yuki Kishimoto])
* pool: add `ReceiverStream` ([Yuki Kishimoto])
Expand Down
8 changes: 8 additions & 0 deletions crates/nostr/src/event/tag/kind.rs
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,14 @@ impl<'a> TagKind<'a> {
Self::SingleLetter(SingleLetterTag::lowercase(Alphabet::H))
}

/// Construct `k` kind
///
/// Shorthand for `TagKind::SingleLetter(SingleLetterTag::lowercase(Alphabet::K))`.
#[inline]
pub fn k() -> Self {
Self::SingleLetter(SingleLetterTag::lowercase(Alphabet::K))
}

/// Construct `p` kind
///
/// Shorthand for `TagKind::SingleLetter(SingleLetterTag::lowercase(Alphabet::P))`.
Expand Down

0 comments on commit 1baac8a

Please sign in to comment.