Skip to content
Snippets Groups Projects
Commit 832dc9a4 authored by Kornel Lesiński's avatar Kornel Lesiński
Browse files

Deprecated error

parent 20b25804
No related branches found
No related tags found
No related merge requests found
......@@ -10,7 +10,7 @@ homepage = "https://lib.rs/crates/lcms2"
documentation = "https://kornelski.github.io/rust-lcms2/lcms2/"
repository = "https://github.com/kornelski/rust-lcms2.git"
categories = ["multimedia::images", "api-bindings"]
version = "5.1.5"
version = "5.1.6"
edition = "2018"
[dependencies]
......
......@@ -24,16 +24,13 @@ pub type LCMSResult<T> = Result<T, Error>;
impl fmt::Display for Error {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(self.description())
}
}
impl StdError for Error {
fn description(&self) -> &str {
match *self {
f.write_str(match *self {
Error::ObjectCreationError => "Could not create the object.\nThe reason is not known, but it's usually caused by wrong input parameters.",
Error::InvalidString => "String is not valid. Contains unsupported characters or is too long.",
Error::MissingData => "Requested data is empty or does not exist.",
}
})
}
}
impl StdError for Error {
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment