aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Krahl <robin.krahl@ireas.org>2019-01-30 19:26:37 +0000
committerRobin Krahl <robin.krahl@ireas.org>2019-07-14 13:49:49 +0000
commit53711cca2edb48e0d4ee6820c6b91f2a115836cd (patch)
tree5bfdc6aa7559ff7ce3d630e93267a5fe87c641d4
parentd4efc5026fd96c3e19df928cfdbed2774c04d743 (diff)
downloadnitrocli-53711cca2edb48e0d4ee6820c6b91f2a115836cd.tar.gz
nitrocli-53711cca2edb48e0d4ee6820c6b91f2a115836cd.tar.bz2
Rename CommandError variant to NitrokeyError
As the error variant not only contains nitrokey::CommandError, but all nitrokey::Error variants, it is renamed from CommandError to NitrokeyError.
-rw-r--r--nitrocli/src/commands.rs2
-rw-r--r--nitrocli/src/error.rs6
2 files changed, 4 insertions, 4 deletions
diff --git a/nitrocli/src/commands.rs b/nitrocli/src/commands.rs
index ff39a12..cf6f841 100644
--- a/nitrocli/src/commands.rs
+++ b/nitrocli/src/commands.rs
@@ -38,7 +38,7 @@ const NITROKEY_DEFAULT_ADMIN_PIN: &str = "12345678";
/// Create an `error::Error` with an error message of the format `msg: err`.
fn get_error(msg: &'static str, err: nitrokey::Error) -> Error {
- Error::CommandError(Some(msg), err)
+ Error::NitrokeyError(Some(msg), err)
}
/// Set `libnitrokey`'s log level based on the execution context's verbosity.
diff --git a/nitrocli/src/error.rs b/nitrocli/src/error.rs
index f18d1a1..388ee4b 100644
--- a/nitrocli/src/error.rs
+++ b/nitrocli/src/error.rs
@@ -25,8 +25,8 @@ use std::string;
#[derive(Debug)]
pub enum Error {
ArgparseError(i32),
- CommandError(Option<&'static str>, nitrokey::Error),
IoError(io::Error),
+ NitrokeyError(Option<&'static str>, nitrokey::Error),
Utf8Error(str::Utf8Error),
Error(String),
}
@@ -39,7 +39,7 @@ impl From<&str> for Error {
impl From<nitrokey::Error> for Error {
fn from(e: nitrokey::Error) -> Error {
- Error::CommandError(None, e)
+ Error::NitrokeyError(None, e)
}
}
@@ -65,7 +65,7 @@ impl fmt::Display for Error {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match *self {
Error::ArgparseError(_) => write!(f, "Could not parse arguments"),
- Error::CommandError(ref ctx, ref e) => {
+ Error::NitrokeyError(ref ctx, ref e) => {
if let Some(ctx) = ctx {
write!(f, "{}: ", ctx)?;
}