aboutsummaryrefslogtreecommitdiff
path: root/src/util.rs
diff options
context:
space:
mode:
authorRobin Krahl <robin.krahl@ireas.org>2019-01-17 04:15:31 +0000
committerRobin Krahl <robin.krahl@ireas.org>2019-01-20 21:08:26 +0000
commit944e1fa0d51e547dde2a9368d2b8431b109f63c4 (patch)
tree0a8b2d5bb9a00149cefb6eecaaf8ac556e961690 /src/util.rs
parentcafc3a6f8cfb9f82343c1d3fe843c7f8d7ef1136 (diff)
downloadnitrokey-rs-944e1fa0d51e547dde2a9368d2b8431b109f63c4.tar.gz
nitrokey-rs-944e1fa0d51e547dde2a9368d2b8431b109f63c4.tar.bz2
Move the CommandError::Unknown to Error
An error code can not only indiciate a command error, but also a library or device communication error. Therefore, the variant for an unknown error code should be placed in the top-level Error enum instead of the CommandError enum.
Diffstat (limited to 'src/util.rs')
-rw-r--r--src/util.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/util.rs b/src/util.rs
index 06bb854..3b9904f 100644
--- a/src/util.rs
+++ b/src/util.rs
@@ -54,7 +54,7 @@ pub fn result_from_string(ptr: *const c_char) -> Result<String, Error> {
pub fn get_command_result(value: c_int) -> Result<(), Error> {
match value {
0 => Ok(()),
- other => Err(CommandError::from(other).into()),
+ other => Err(Error::from(other)),
}
}