Shorter idiomatic expression for finding preferred crypto algorithm
This commit is contained in:
@@ -130,12 +130,7 @@ const SUPPORTED_CRED_PARAMS: &[PublicKeyCredentialParameter] = &[
|
|||||||
];
|
];
|
||||||
|
|
||||||
fn get_preferred_cred_param (params: &[PublicKeyCredentialParameter]) -> Option<&PublicKeyCredentialParameter> {
|
fn get_preferred_cred_param (params: &[PublicKeyCredentialParameter]) -> Option<&PublicKeyCredentialParameter> {
|
||||||
for param in params {
|
params.iter().find(|¶m| SUPPORTED_CRED_PARAMS.contains(param))
|
||||||
if SUPPORTED_CRED_PARAMS.contains(param) {
|
|
||||||
return Some(param);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return None;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Transports supported by OpenSK.
|
/// Transports supported by OpenSK.
|
||||||
|
|||||||
Reference in New Issue
Block a user