From 832dc9a419cd098cec6291fa6140a265c45eaa98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kornel=20Lesin=CC=81ski?= <kornel@geekhood.net> Date: Tue, 5 May 2020 16:24:13 +0100 Subject: [PATCH] Deprecated error --- Cargo.toml | 2 +- src/error.rs | 13 +++++-------- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 28ee403..664fa6f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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] diff --git a/src/error.rs b/src/error.rs index 86f93fd..d20605f 100644 --- a/src/error.rs +++ b/src/error.rs @@ -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 { +} -- GitLab