summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Krahl <robin.krahl@ireas.org>2019-01-17 01:58:42 +0000
committerRobin Krahl <robin.krahl@ireas.org>2019-01-20 20:57:07 +0000
commit591c55ff294ee12812e4be1b90f03a093f83a4f5 (patch)
tree3dd154e902c931ea56bc72667412676e023b7a9d
parentd0f63513bb935d3d931c86a1ab7b68d6ed44bf27 (diff)
downloadnitrokey-rs-591c55ff294ee12812e4be1b90f03a093f83a4f5.tar.gz
nitrokey-rs-591c55ff294ee12812e4be1b90f03a093f83a4f5.tar.bz2
Implement std::error::Error for error::CommandError
-rw-r--r--CHANGELOG.md1
-rw-r--r--src/error.rs3
2 files changed, 4 insertions, 0 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 6c5ebf3..d2982a9 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,6 +2,7 @@
- Remove the `test-pro` and `test-storage` features.
- Implement `Display` for `Version`.
- Introduce `DEFAULT_ADMIN_PIN` and `DEFAULT_USER_PIN` constants.
+- Implement `std::error::Error` for `CommandError`.
# v0.3.4 (2019-01-20)
- Fix authentication methods that assumed that `char` is signed.
diff --git a/src/error.rs b/src/error.rs
index 6aeeef8..dcaa4d2 100644
--- a/src/error.rs
+++ b/src/error.rs
@@ -1,4 +1,5 @@
use std::borrow;
+use std::error;
use std::fmt;
use std::os::raw;
@@ -79,6 +80,8 @@ impl CommandError {
}
}
+impl error::Error for CommandError {}
+
impl fmt::Display for CommandError {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "{}", self.as_str())