refractor

This commit is contained in:
2019-09-17 14:27:42 +02:00
parent f7b7617e0e
commit 4679e939cf
7 changed files with 359 additions and 202 deletions

View File

@@ -21,8 +21,11 @@ pub enum Fido2LuksError {
ConfigurationError { cause: serde_json::error::Error },
#[fail(display = "the submitted secret is not applicable to this luks device")]
WrongSecret,
#[fail(display = "not an utf8 string")]
StringEncodingError { cause: FromUtf8Error },
}
use std::string::FromUtf8Error;
use Fido2LuksError::*;
impl From<FidoError> for Fido2LuksError {
@@ -48,3 +51,9 @@ impl From<serde_json::error::Error> for Fido2LuksError {
ConfigurationError { cause: e }
}
}
impl From<FromUtf8Error> for Fido2LuksError {
fn from(e: FromUtf8Error) -> Self {
StringEncodingError { cause: e }
}
}