parser: add utf8 seeking functions
useful for peeking the previous utf8 char on a 0-copy utf8 buffer view
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
use crate::parser;
|
||||
|
||||
#[derive(Eq, PartialEq, Debug)]
|
||||
pub enum Error {
|
||||
Nostr(enostr::Error),
|
||||
Parse(parser::Error),
|
||||
Generic(String),
|
||||
}
|
||||
|
||||
@@ -10,6 +13,12 @@ impl From<String> for Error {
|
||||
}
|
||||
}
|
||||
|
||||
impl From<parser::Error> for Error {
|
||||
fn from(s: parser::Error) -> Self {
|
||||
Error::Parse(s)
|
||||
}
|
||||
}
|
||||
|
||||
impl From<enostr::Error> for Error {
|
||||
fn from(err: enostr::Error) -> Self {
|
||||
Error::Nostr(err)
|
||||
|
||||
Reference in New Issue
Block a user