Skip to content

Commit

Permalink
nostr: improve Tag::parse performance
Browse files Browse the repository at this point in the history
  • Loading branch information
yukibtc committed Oct 26, 2023
1 parent 237f778 commit 819d951
Show file tree
Hide file tree
Showing 2 changed files with 180 additions and 114 deletions.
4 changes: 2 additions & 2 deletions crates/nostr/src/event/id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@ impl EventId {
/// [`EventId`] hex string
pub fn from_hex<S>(hex: S) -> Result<Self, Error>
where
S: Into<String>,
S: AsRef<str>,
{
Ok(Self(Sha256Hash::from_str(&hex.into())?))
Ok(Self(Sha256Hash::from_str(hex.as_ref())?))
}

/// [`EventId`] from bytes
Expand Down
Loading

0 comments on commit 819d951

Please sign in to comment.