summaryrefslogtreecommitdiff
path: root/src/tests/mod.rs
diff options
context:
space:
mode:
authorDaniel Mueller <deso@posteo.net>2020-07-09 19:01:52 -0700
committerDaniel Mueller <deso@posteo.net>2020-07-09 19:01:52 -0700
commit756dc2ed9d16a3edbfdc4778feb11f0b0c84d897 (patch)
treeb1d9c02a9065236502b639e241733d91b2fe9a94 /src/tests/mod.rs
parentc461a506f6bf3bf73374df289298879ba9d2d125 (diff)
downloadnitrocli-756dc2ed9d16a3edbfdc4778feb11f0b0c84d897.tar.gz
nitrocli-756dc2ed9d16a3edbfdc4778feb11f0b0c84d897.tar.bz2
Remove UnwrapError test trait
This change wraps up the removal of the UnwrapError test trait. This step prepares us for the subsequent removal of the application's global Error enum type, in favor of the usage of anyhow's Error type.
Diffstat (limited to 'src/tests/mod.rs')
-rw-r--r--src/tests/mod.rs22
1 files changed, 0 insertions, 22 deletions
diff --git a/src/tests/mod.rs b/src/tests/mod.rs
index 65223ae..878a26f 100644
--- a/src/tests/mod.rs
+++ b/src/tests/mod.rs
@@ -18,7 +18,6 @@
// *************************************************************************
use std::ffi;
-use std::fmt;
use nitrokey_test::test as test_device;
@@ -35,27 +34,6 @@ mod run;
mod status;
mod unencrypted;
-/// A trait simplifying checking for expected errors.
-pub trait UnwrapError {
- /// Unwrap a Error::CommandError variant.
- fn unwrap_cmd_err(self) -> (Option<&'static str>, nitrokey::CommandError);
-}
-
-impl<T> UnwrapError for crate::Result<T>
-where
- T: fmt::Debug,
-{
- fn unwrap_cmd_err(self) -> (Option<&'static str>, nitrokey::CommandError) {
- match self.unwrap_err() {
- crate::Error::NitrokeyError(ctx, err) => match err {
- nitrokey::Error::CommandError(err) => (ctx, err),
- err => panic!("Unexpected error variant found: {:?}", err),
- },
- err => panic!("Unexpected error variant found: {:?}", err),
- }
- }
-}
-
struct Nitrocli {
model: Option<nitrokey::Model>,
admin_pin: Option<ffi::OsString>,