Apply suggestion to remove additional semi-colons.
This commit is contained in:
@@ -48,7 +48,7 @@ use core::iter::Peekable;
|
|||||||
/// 1 => x,
|
/// 1 => x,
|
||||||
/// "key" => y,
|
/// "key" => y,
|
||||||
/// } = map;
|
/// } = map;
|
||||||
/// };
|
/// }
|
||||||
/// # }
|
/// # }
|
||||||
/// ```
|
/// ```
|
||||||
///
|
///
|
||||||
@@ -653,7 +653,7 @@ mod test {
|
|||||||
1 => x1,
|
1 => x1,
|
||||||
2 => x2,
|
2 => x2,
|
||||||
} = extract_map(map);
|
} = extract_map(map);
|
||||||
};
|
}
|
||||||
|
|
||||||
assert_eq!(x1, Some(cbor_unsigned!(10)));
|
assert_eq!(x1, Some(cbor_unsigned!(10)));
|
||||||
assert_eq!(x2, Some(cbor_unsigned!(20)));
|
assert_eq!(x2, Some(cbor_unsigned!(20)));
|
||||||
@@ -674,7 +674,7 @@ mod test {
|
|||||||
2 => _x2,
|
2 => _x2,
|
||||||
1 => _x1,
|
1 => _x1,
|
||||||
} = extract_map(map);
|
} = extract_map(map);
|
||||||
};
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@@ -696,7 +696,7 @@ mod test {
|
|||||||
3 => x3,
|
3 => x3,
|
||||||
7 => x7,
|
7 => x7,
|
||||||
} = extract_map(map);
|
} = extract_map(map);
|
||||||
};
|
}
|
||||||
|
|
||||||
assert_eq!(x3, Some(cbor_unsigned!(30)));
|
assert_eq!(x3, Some(cbor_unsigned!(30)));
|
||||||
assert_eq!(x7, Some(cbor_unsigned!(70)));
|
assert_eq!(x7, Some(cbor_unsigned!(70)));
|
||||||
@@ -719,7 +719,7 @@ mod test {
|
|||||||
4 => x4,
|
4 => x4,
|
||||||
5 => x5,
|
5 => x5,
|
||||||
} = extract_map(map);
|
} = extract_map(map);
|
||||||
};
|
}
|
||||||
|
|
||||||
assert_eq!(x0, None);
|
assert_eq!(x0, None);
|
||||||
assert_eq!(x1, Some(cbor_unsigned!(10)));
|
assert_eq!(x1, Some(cbor_unsigned!(10)));
|
||||||
|
|||||||
@@ -136,7 +136,7 @@ impl TryFrom<cbor::Value> for AuthenticatorMakeCredentialParameters {
|
|||||||
8 => pin_uv_auth_param,
|
8 => pin_uv_auth_param,
|
||||||
9 => pin_uv_auth_protocol,
|
9 => pin_uv_auth_protocol,
|
||||||
} = extract_map(cbor_value)?;
|
} = extract_map(cbor_value)?;
|
||||||
};
|
}
|
||||||
|
|
||||||
let client_data_hash = extract_byte_string(ok_or_missing(client_data_hash)?)?;
|
let client_data_hash = extract_byte_string(ok_or_missing(client_data_hash)?)?;
|
||||||
let rp = PublicKeyCredentialRpEntity::try_from(ok_or_missing(rp)?)?;
|
let rp = PublicKeyCredentialRpEntity::try_from(ok_or_missing(rp)?)?;
|
||||||
@@ -217,7 +217,7 @@ impl TryFrom<cbor::Value> for AuthenticatorGetAssertionParameters {
|
|||||||
6 => pin_uv_auth_param,
|
6 => pin_uv_auth_param,
|
||||||
7 => pin_uv_auth_protocol,
|
7 => pin_uv_auth_protocol,
|
||||||
} = extract_map(cbor_value)?;
|
} = extract_map(cbor_value)?;
|
||||||
};
|
}
|
||||||
|
|
||||||
let rp_id = extract_text_string(ok_or_missing(rp_id)?)?;
|
let rp_id = extract_text_string(ok_or_missing(rp_id)?)?;
|
||||||
let client_data_hash = extract_byte_string(ok_or_missing(client_data_hash)?)?;
|
let client_data_hash = extract_byte_string(ok_or_missing(client_data_hash)?)?;
|
||||||
@@ -286,7 +286,7 @@ impl TryFrom<cbor::Value> for AuthenticatorClientPinParameters {
|
|||||||
5 => new_pin_enc,
|
5 => new_pin_enc,
|
||||||
6 => pin_hash_enc,
|
6 => pin_hash_enc,
|
||||||
} = extract_map(cbor_value)?;
|
} = extract_map(cbor_value)?;
|
||||||
};
|
}
|
||||||
|
|
||||||
let pin_protocol = extract_unsigned(ok_or_missing(pin_protocol)?)?;
|
let pin_protocol = extract_unsigned(ok_or_missing(pin_protocol)?)?;
|
||||||
let sub_command = ClientPinSubCommand::try_from(ok_or_missing(sub_command)?)?;
|
let sub_command = ClientPinSubCommand::try_from(ok_or_missing(sub_command)?)?;
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ impl TryFrom<cbor::Value> for PublicKeyCredentialRpEntity {
|
|||||||
"icon" => rp_icon,
|
"icon" => rp_icon,
|
||||||
"name" => rp_name,
|
"name" => rp_name,
|
||||||
} = extract_map(cbor_value)?;
|
} = extract_map(cbor_value)?;
|
||||||
};
|
}
|
||||||
|
|
||||||
let rp_id = extract_text_string(ok_or_missing(rp_id)?)?;
|
let rp_id = extract_text_string(ok_or_missing(rp_id)?)?;
|
||||||
let rp_name = rp_name.map(extract_text_string).transpose()?;
|
let rp_name = rp_name.map(extract_text_string).transpose()?;
|
||||||
@@ -71,7 +71,7 @@ impl TryFrom<cbor::Value> for PublicKeyCredentialUserEntity {
|
|||||||
"name" => user_name,
|
"name" => user_name,
|
||||||
"displayName" => user_display_name,
|
"displayName" => user_display_name,
|
||||||
} = extract_map(cbor_value)?;
|
} = extract_map(cbor_value)?;
|
||||||
};
|
}
|
||||||
|
|
||||||
let user_id = extract_byte_string(ok_or_missing(user_id)?)?;
|
let user_id = extract_byte_string(ok_or_missing(user_id)?)?;
|
||||||
let user_name = user_name.map(extract_text_string).transpose()?;
|
let user_name = user_name.map(extract_text_string).transpose()?;
|
||||||
@@ -148,7 +148,7 @@ impl TryFrom<cbor::Value> for PublicKeyCredentialParameter {
|
|||||||
"alg" => alg,
|
"alg" => alg,
|
||||||
"type" => cred_type,
|
"type" => cred_type,
|
||||||
} = extract_map(cbor_value)?;
|
} = extract_map(cbor_value)?;
|
||||||
};
|
}
|
||||||
|
|
||||||
let cred_type = PublicKeyCredentialType::try_from(ok_or_missing(cred_type)?)?;
|
let cred_type = PublicKeyCredentialType::try_from(ok_or_missing(cred_type)?)?;
|
||||||
let alg = SignatureAlgorithm::try_from(ok_or_missing(alg)?)?;
|
let alg = SignatureAlgorithm::try_from(ok_or_missing(alg)?)?;
|
||||||
@@ -219,7 +219,7 @@ impl TryFrom<cbor::Value> for PublicKeyCredentialDescriptor {
|
|||||||
"type" => key_type,
|
"type" => key_type,
|
||||||
"transports" => transports,
|
"transports" => transports,
|
||||||
} = extract_map(cbor_value)?;
|
} = extract_map(cbor_value)?;
|
||||||
};
|
}
|
||||||
|
|
||||||
let key_type = PublicKeyCredentialType::try_from(ok_or_missing(key_type)?)?;
|
let key_type = PublicKeyCredentialType::try_from(ok_or_missing(key_type)?)?;
|
||||||
let key_id = extract_byte_string(ok_or_missing(key_id)?)?;
|
let key_id = extract_byte_string(ok_or_missing(key_id)?)?;
|
||||||
@@ -268,7 +268,7 @@ impl TryFrom<cbor::Value> for MakeCredentialExtensions {
|
|||||||
"credProtect" => cred_protect,
|
"credProtect" => cred_protect,
|
||||||
"hmac-secret" => hmac_secret,
|
"hmac-secret" => hmac_secret,
|
||||||
} = extract_map(cbor_value)?;
|
} = extract_map(cbor_value)?;
|
||||||
};
|
}
|
||||||
|
|
||||||
let hmac_secret = hmac_secret.map_or(Ok(false), extract_bool)?;
|
let hmac_secret = hmac_secret.map_or(Ok(false), extract_bool)?;
|
||||||
let cred_protect = cred_protect
|
let cred_protect = cred_protect
|
||||||
@@ -294,7 +294,7 @@ impl TryFrom<cbor::Value> for GetAssertionExtensions {
|
|||||||
let {
|
let {
|
||||||
"hmac-secret" => hmac_secret,
|
"hmac-secret" => hmac_secret,
|
||||||
} = extract_map(cbor_value)?;
|
} = extract_map(cbor_value)?;
|
||||||
};
|
}
|
||||||
|
|
||||||
let hmac_secret = hmac_secret
|
let hmac_secret = hmac_secret
|
||||||
.map(GetAssertionHmacSecretInput::try_from)
|
.map(GetAssertionHmacSecretInput::try_from)
|
||||||
@@ -320,7 +320,7 @@ impl TryFrom<cbor::Value> for GetAssertionHmacSecretInput {
|
|||||||
2 => salt_enc,
|
2 => salt_enc,
|
||||||
3 => salt_auth,
|
3 => salt_auth,
|
||||||
} = extract_map(cbor_value)?;
|
} = extract_map(cbor_value)?;
|
||||||
};
|
}
|
||||||
|
|
||||||
let cose_key = extract_map(ok_or_missing(cose_key)?)?;
|
let cose_key = extract_map(ok_or_missing(cose_key)?)?;
|
||||||
let salt_enc = extract_byte_string(ok_or_missing(salt_enc)?)?;
|
let salt_enc = extract_byte_string(ok_or_missing(salt_enc)?)?;
|
||||||
@@ -350,7 +350,7 @@ impl TryFrom<cbor::Value> for MakeCredentialOptions {
|
|||||||
"up" => up,
|
"up" => up,
|
||||||
"uv" => uv,
|
"uv" => uv,
|
||||||
} = extract_map(cbor_value)?;
|
} = extract_map(cbor_value)?;
|
||||||
};
|
}
|
||||||
|
|
||||||
let rk = match rk {
|
let rk = match rk {
|
||||||
Some(options_entry) => extract_bool(options_entry)?,
|
Some(options_entry) => extract_bool(options_entry)?,
|
||||||
@@ -385,7 +385,7 @@ impl TryFrom<cbor::Value> for GetAssertionOptions {
|
|||||||
"up" => up,
|
"up" => up,
|
||||||
"uv" => uv,
|
"uv" => uv,
|
||||||
} = extract_map(cbor_value)?;
|
} = extract_map(cbor_value)?;
|
||||||
};
|
}
|
||||||
|
|
||||||
if let Some(options_entry) = rk {
|
if let Some(options_entry) = rk {
|
||||||
// This is only for returning the correct status code.
|
// This is only for returning the correct status code.
|
||||||
@@ -552,7 +552,7 @@ impl TryFrom<cbor::Value> for PublicKeyCredentialSource {
|
|||||||
CredRandom => cred_random,
|
CredRandom => cred_random,
|
||||||
CredProtectPolicy => cred_protect_policy,
|
CredProtectPolicy => cred_protect_policy,
|
||||||
} = extract_map(cbor_value)?;
|
} = extract_map(cbor_value)?;
|
||||||
};
|
}
|
||||||
|
|
||||||
let credential_id = extract_byte_string(ok_or_missing(credential_id)?)?;
|
let credential_id = extract_byte_string(ok_or_missing(credential_id)?)?;
|
||||||
let private_key = extract_byte_string(ok_or_missing(private_key)?)?;
|
let private_key = extract_byte_string(ok_or_missing(private_key)?)?;
|
||||||
@@ -651,7 +651,7 @@ impl TryFrom<CoseKey> for ecdh::PubKey {
|
|||||||
-2 => x_bytes,
|
-2 => x_bytes,
|
||||||
-3 => y_bytes,
|
-3 => y_bytes,
|
||||||
} = cose_key.0;
|
} = cose_key.0;
|
||||||
};
|
}
|
||||||
|
|
||||||
let key_type = extract_integer(ok_or_missing(key_type)?)?;
|
let key_type = extract_integer(ok_or_missing(key_type)?)?;
|
||||||
if key_type != EC2_KEY_TYPE {
|
if key_type != EC2_KEY_TYPE {
|
||||||
|
|||||||
Reference in New Issue
Block a user