aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG.md4
-rw-r--r--src/error.rs16
2 files changed, 5 insertions, 15 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 736620d..e89fc44 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -3,6 +3,10 @@ Copyright (C) 2019-2020 Robin Krahl <robin.krahl@ireas.org>
SPDX-License-Identifier: CC0-1.0
-->
+# Unreleased
+- Remove the custom `std::error::Error::source` implementation for
+ `error::Error` to avoid duplicate error messages.
+
# v0.7.0 (2020-07-14)
- Refactor the `Error` enum so that it is `Send`, `Sync` and `'static`:
- Remove the `sync::PoisonError` from the `PoisonError` variant.
diff --git a/src/error.rs b/src/error.rs
index 1aa1793..64a2ce0 100644
--- a/src/error.rs
+++ b/src/error.rs
@@ -91,21 +91,7 @@ impl<'a, T: device::Device<'a>> From<(T, Error)> for Error {
}
}
-impl error::Error for Error {
- fn source(&self) -> Option<&(dyn error::Error + 'static)> {
- match *self {
- Error::CommandError(ref err) => Some(err),
- Error::CommunicationError(ref err) => Some(err),
- Error::ConcurrentAccessError => None,
- Error::LibraryError(ref err) => Some(err),
- Error::PoisonError => None,
- Error::UnexpectedError(_) => None,
- Error::UnknownError(_) => None,
- Error::UnsupportedModelError => None,
- Error::Utf8Error(ref err) => Some(err),
- }
- }
-}
+impl error::Error for Error {}
impl fmt::Display for Error {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {