aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRobin Krahl <robin.krahl@ireas.org>2019-01-27 13:36:13 +0000
committerRobin Krahl <robin.krahl@ireas.org>2019-01-27 13:38:07 +0000
commit33a65c1635e54ae51089ef3c37a749d67853be02 (patch)
tree3b615b2f8316b39eb5e550f4df6d6c412e683b95 /src
parenta30562638aed90d113739bb36dd6814f6cf7ace2 (diff)
downloadnitrokey-rs-33a65c1635e54ae51089ef3c37a749d67853be02.tar.gz
nitrokey-rs-33a65c1635e54ae51089ef3c37a749d67853be02.tar.bz2
Rename Error::Unknown to Error::UnknownError
For consistency with the other Error variants, we rename Unknown to UnknownError.
Diffstat (limited to 'src')
-rw-r--r--src/error.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/error.rs b/src/error.rs
index 5c8c52e..1730171 100644
--- a/src/error.rs
+++ b/src/error.rs
@@ -22,7 +22,7 @@ pub enum Error {
/// An error that is caused by an unexpected value returned by libnitrokey.
UnexpectedError,
/// An unknown error returned by libnitrokey.
- Unknown(i64),
+ UnknownError(i64),
/// An error occurred when interpreting a UTF-8 string.
Utf8Error(str::Utf8Error),
}
@@ -36,7 +36,7 @@ impl From<raw::c_int> for Error {
} else if let Some(err) = LibraryError::try_from(code) {
Error::LibraryError(err)
} else {
- Error::Unknown(code.into())
+ Error::UnknownError(code.into())
}
}
}
@@ -79,7 +79,7 @@ impl error::Error for Error {
Error::LibraryError(ref err) => Some(err),
Error::RandError(ref err) => Some(err.as_ref()),
Error::UnexpectedError => None,
- Error::Unknown(_) => None,
+ Error::UnknownError(_) => None,
Error::Utf8Error(ref err) => Some(err),
}
}
@@ -93,7 +93,7 @@ impl fmt::Display for Error {
Error::LibraryError(ref err) => write!(f, "Library error: {}", err),
Error::RandError(ref err) => write!(f, "RNG error: {}", err),
Error::UnexpectedError => write!(f, "An unexpected error occurred"),
- Error::Unknown(ref err) => write!(f, "Unknown error: {}", err),
+ Error::UnknownError(ref err) => write!(f, "Unknown error: {}", err),
Error::Utf8Error(ref err) => write!(f, "UTF-8 error: {}", err),
}
}