Skip to content

Commit

Permalink
ffi(nostr): add Tag::kind_str method
Browse files Browse the repository at this point in the history
Signed-off-by: Yuki Kishimoto <[email protected]>
  • Loading branch information
yukibtc committed Sep 26, 2024
1 parent 93a02f7 commit 5111258
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
* pool: add `RelayFiltering::overwrite_public_keys` method ([Yuki Kishimoto])
* zapper: add `WebLNZapper` struct (moved from `nostr-webln` crate) ([Yuki Kishimoto])
* ffi(nostr): add `tag_kind_to_string` func ([Yuki Kishimoto])
* ffi(nostr): add `Tag::kind_str` method ([Yuki Kishimoto])
* book: add some examples ([RydalWater])

### Fixed
Expand Down
6 changes: 6 additions & 0 deletions bindings/nostr-ffi/src/event/tag.rs
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,12 @@ impl Tag {
self.inner.kind().into()
}

/// Get tag kind as string
#[inline]
pub fn kind_str(&self) -> String {
self.inner.kind().to_string()
}

/// Return the **first** tag value (index `1`), if exists.
#[inline]
pub fn content(&self) -> Option<String> {
Expand Down

0 comments on commit 5111258

Please sign in to comment.