error: implement InfallibleError

This commit is contained in:
ghassmo
2022-04-11 09:24:43 +04:00
parent dca3d745b4
commit d0778e890f

View File

@@ -32,7 +32,7 @@ pub enum Error {
#[error(transparent)]
ParseBigIntError(#[from] num_bigint::ParseBigIntError),
#[cfg(any(feature = "rpc", feature = "node"))]
#[cfg(any(feature = "rpc", feature = "node", feature = "util"))]
#[error("Url parse error `{0}`")]
UrlParseError(String),
@@ -272,7 +272,7 @@ impl From<async_native_tls::Error> for Error {
}
}
#[cfg(feature = "rpc")]
#[cfg(any(feature = "rpc", feature = "util"))]
impl From<url::ParseError> for Error {
fn from(err: url::ParseError) -> Error {
Error::UrlParseError(err.to_string())
@@ -319,6 +319,12 @@ impl From<std::convert::Infallible> for Error {
}
}
impl From<()> for Error {
fn from(_err: ()) -> Error {
Error::InfallibleError("Infallible".into())
}
}
#[cfg(feature = "crypto")]
impl From<halo2_proofs::plonk::Error> for Error {
fn from(err: halo2_proofs::plonk::Error) -> Error {