diff --git a/Cargo.lock b/Cargo.lock index 91c070c5..0a72dc35 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -418,7 +418,7 @@ dependencies = [ [[package]] name = "rustls-webpki" -version = "0.104.0-alpha.3" +version = "0.104.0-alpha.4" dependencies = [ "base64", "bencher", diff --git a/Cargo.toml b/Cargo.toml index 962bd128..9a709a84 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -21,7 +21,7 @@ license = "ISC" name = "rustls-webpki" readme = "README.md" repository = "https://github.com/rustls/webpki" -version = "0.104.0-alpha.3" +version = "0.104.0-alpha.4" include = [ "Cargo.toml", diff --git a/src/sct.rs b/src/sct.rs index e49d2516..da2fbe39 100644 --- a/src/sct.rs +++ b/src/sct.rs @@ -1,3 +1,5 @@ +use core::error::Error as StdError; +use core::fmt; use core::marker::PhantomData; use untrusted::{Input, Reader}; @@ -136,6 +138,17 @@ pub enum Error { UnsupportedSctVersion, } +impl fmt::Display for Error { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + match self { + Self::MalformedSct => write!(f, "malformed SCT"), + Self::UnsupportedSctVersion => write!(f, "unsupported SCT version"), + } + } +} + +impl StdError for Error {} + #[cfg(test)] mod tests { use super::*;