aboutsummaryrefslogtreecommitdiff
path: root/nitrocli/src/error.rs
diff options
context:
space:
mode:
authorDaniel Mueller <deso@posteo.net>2019-07-17 19:14:03 -0700
committerDaniel Mueller <deso@posteo.net>2019-07-17 19:14:03 -0700
commitef47e3f21498ec886508a344d7c0d5f739117a84 (patch)
treebf391dc273148494989edbeed0df5bbb79b372eb /nitrocli/src/error.rs
parent04bf10c88cea1e92db096407a7f89890f3598969 (diff)
downloadnitrocli-ef47e3f21498ec886508a344d7c0d5f739117a84.tar.gz
nitrocli-ef47e3f21498ec886508a344d7c0d5f739117a84.tar.bz2
Update nitrokey crate to 0.4.0-alpha.0
This is patch marks the first step in the process of updating the nitrokey dependency to version 0.4. In particular, it integrates with the first alpha version. The main change on the nitrocli side accompanying the version bump is that the nitrokey::CommandError got replaced by a more general nitrokey::Error which includes the former variant. Import subrepo nitrokey/:nitrokey at d433189caefe6bd6c88da7fbb1d6e9304353eb83
Diffstat (limited to 'nitrocli/src/error.rs')
-rw-r--r--nitrocli/src/error.rs16
1 files changed, 8 insertions, 8 deletions
diff --git a/nitrocli/src/error.rs b/nitrocli/src/error.rs
index c0e7403..819bed8 100644
--- a/nitrocli/src/error.rs
+++ b/nitrocli/src/error.rs
@@ -41,16 +41,16 @@ where
#[derive(Debug)]
pub enum Error {
ArgparseError(i32),
- CommandError(Option<&'static str>, nitrokey::CommandError),
IoError(io::Error),
+ NitrokeyError(Option<&'static str>, nitrokey::Error),
Utf8Error(str::Utf8Error),
Error(String),
}
-impl TryInto<nitrokey::CommandError> for Error {
- fn try_into(self) -> Result<nitrokey::CommandError, Error> {
+impl TryInto<nitrokey::Error> for Error {
+ fn try_into(self) -> Result<nitrokey::Error, Error> {
match self {
- Error::CommandError(_, err) => Ok(err),
+ Error::NitrokeyError(_, err) => Ok(err),
err => Err(err),
}
}
@@ -62,9 +62,9 @@ impl From<&str> for Error {
}
}
-impl From<nitrokey::CommandError> for Error {
- fn from(e: nitrokey::CommandError) -> Error {
- Error::CommandError(None, e)
+impl From<nitrokey::Error> for Error {
+ fn from(e: nitrokey::Error) -> Error {
+ Error::NitrokeyError(None, e)
}
}
@@ -90,7 +90,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)?;
}