remove duplicate filter types
only use nostrdb::Filter Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
@@ -14,6 +14,7 @@ pub enum Error {
|
||||
InvalidPublicKey,
|
||||
// Secp(secp256k1::Error),
|
||||
Json(serde_json::Error),
|
||||
Nostrdb(nostrdb::Error),
|
||||
Generic(String),
|
||||
}
|
||||
|
||||
@@ -29,6 +30,7 @@ impl std::cmp::PartialEq for Error {
|
||||
// This is slightly wrong but whatevs
|
||||
(Error::Json(..), Error::Json(..)) => true,
|
||||
(Error::Generic(left), Error::Generic(right)) => left == right,
|
||||
(Error::Nostrdb(left), Error::Nostrdb(right)) => left == right,
|
||||
//(Error::Secp(left), Error::Secp(right)) => left == right,
|
||||
_ => false,
|
||||
}
|
||||
@@ -47,6 +49,7 @@ impl fmt::Display for Error {
|
||||
Self::InvalidPublicKey => write!(f, "invalid public key"),
|
||||
//Self::Secp(e) => write!(f, "{e}"),
|
||||
Self::Json(e) => write!(f, "{e}"),
|
||||
Self::Nostrdb(e) => write!(f, "{e}"),
|
||||
Self::Generic(e) => write!(f, "{e}"),
|
||||
}
|
||||
}
|
||||
@@ -85,3 +88,9 @@ impl From<serde_json::Error> for Error {
|
||||
Error::Json(e)
|
||||
}
|
||||
}
|
||||
|
||||
impl From<nostrdb::Error> for Error {
|
||||
fn from(e: nostrdb::Error) -> Self {
|
||||
Error::Nostrdb(e)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user