add display instance to Error
@@ -19,3 +19,15 @@ impl From<std::io::Error> for Error {
Error::IoError(e)
}
}
+
+impl std::fmt::Display for Error {
+ fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+ match self {
+ Error::InvalidInputLength => "invalid input length".fmt(f),
+ Error::IoError(e) => write!(f, "IO error: {}", e),
+ Error::Other(s) => write!(f, "other error: {}", s),
+ Error::CommitmentCheck => "committment check failed".fmt(f),
+ Error::DecompressPoint => "could not decompress point".fmt(f),
+ }
+ }
+}
