diff options
author | Robin Krahl <robin.krahl@ireas.org> | 2019-01-17 12:47:52 +0000 |
---|---|---|
committer | Robin Krahl <robin.krahl@ireas.org> | 2019-01-20 21:08:50 +0000 |
commit | 5e258d26b55af6bed7c316b1c7ac12e20946702d (patch) | |
tree | fee2be71586bef2f1978eb1cf40ef84c8ac6492b /src/config.rs | |
parent | 944e1fa0d51e547dde2a9368d2b8431b109f63c4 (diff) | |
download | nitrokey-rs-5e258d26b55af6bed7c316b1c7ac12e20946702d.tar.gz nitrokey-rs-5e258d26b55af6bed7c316b1c7ac12e20946702d.tar.bz2 |
Refactor library errors into LibraryError enum
Previously, library errors were part of the CommandError enum. As
command errors and library errors are two different error types, they
should be split into two enums.
Diffstat (limited to 'src/config.rs')
-rw-r--r-- | src/config.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/config.rs b/src/config.rs index 741d67e..6aa6d10 100644 --- a/src/config.rs +++ b/src/config.rs @@ -1,4 +1,4 @@ -use crate::error::{CommandError, Error}; +use crate::error::{Error, LibraryError}; /// The configuration for a Nitrokey. #[derive(Clone, Copy, Debug, PartialEq)] @@ -41,7 +41,7 @@ fn option_to_config_otp_slot(value: Option<u8>) -> Result<u8, Error> { if value < 3 { Ok(value) } else { - Err(CommandError::InvalidSlot.into()) + Err(LibraryError::InvalidSlot.into()) } } None => Ok(255), |