diff --git a/crates/notedeck/src/note.rs b/crates/notedeck/src/note.rs index 4c351b1..e342186 100644 --- a/crates/notedeck/src/note.rs +++ b/crates/notedeck/src/note.rs @@ -34,6 +34,10 @@ impl RootNoteIdBuf { root_note_id_from_selected_id(ndb, note_cache, txn, id).map(|rnid| Self(*rnid.bytes())) } + pub fn hex(&self) -> String { + hex::encode(self.bytes()) + } + pub fn new_unsafe(id: [u8; 32]) -> Self { Self(id) } @@ -52,6 +56,10 @@ impl<'a> RootNoteId<'a> { self.0 } + pub fn hex(&self) -> String { + hex::encode(self.bytes()) + } + pub fn to_owned(&self) -> RootNoteIdBuf { RootNoteIdBuf::new_unsafe(*self.bytes()) }