From a33aad1f62a246576fbc017d7e1c0458fc55ff72 Mon Sep 17 00:00:00 2001 From: William Casarin Date: Sat, 19 Apr 2025 19:34:12 -0700 Subject: [PATCH] note: fix from_hex crash on bad note ids --- crates/enostr/src/note.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/enostr/src/note.rs b/crates/enostr/src/note.rs index 12a0564..cfd7550 100644 --- a/crates/enostr/src/note.rs +++ b/crates/enostr/src/note.rs @@ -29,7 +29,7 @@ impl NoteId { } pub fn from_hex(hex_str: &str) -> Result { - let evid = NoteId(hex::decode(hex_str)?.as_slice().try_into().unwrap()); + let evid = NoteId(hex::decode(hex_str)?.as_slice().try_into()?); Ok(evid) }