chore: use opt_result!
This commit is contained in:
@@ -64,10 +64,9 @@ pub struct U2fRegistrationData {
|
||||
|
||||
impl U2fRegistrationData {
|
||||
pub fn from(app_id: &str, client_data: &str, register_result: RegisterResult) -> XResult<Self> {
|
||||
let rr = match u2f::register::parse_registration(app_id.to_string(), client_data.as_bytes().to_vec(), register_result.0.to_vec()) {
|
||||
Ok(rr) => rr,
|
||||
Err(e) => return simple_error!("Parse registration data failed: {}", e),
|
||||
};
|
||||
let rr = opt_result!(
|
||||
u2f::register::parse_registration(app_id.to_string(), client_data.as_bytes().to_vec(), register_result.0.to_vec()),
|
||||
"Parse registration data failed: {}");
|
||||
Ok(Self {
|
||||
app_id: app_id.to_string(),
|
||||
device_info: U2FDeviceInfo::from(®ister_result),
|
||||
|
||||
Reference in New Issue
Block a user