mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2025-07-15 00:35:01 +00:00
Use more idomatic code - take 2
Signed-off-by: BlackDex <black.dex@gmail.com>
This commit is contained in:
parent
c62db91ab2
commit
1558774c75
1 changed files with 1 additions and 2 deletions
|
@ -152,8 +152,7 @@ async fn activate_yubikey(data: Json<EnableYubikeyData>, headers: Headers, mut c
|
|||
verify_yubikey_otp(yubikey.to_owned()).await.map_res("Invalid Yubikey OTP provided")?;
|
||||
}
|
||||
|
||||
let yubikey_ids: Vec<String> =
|
||||
yubikeys.into_iter().filter_map(|x| (x.len() >= 12).then(|| x[..12].to_owned())).collect();
|
||||
let yubikey_ids: Vec<String> = yubikeys.into_iter().filter_map(|x| x.get(..12).map(str::to_owned)).collect();
|
||||
|
||||
let yubikey_metadata = YubikeyMetadata {
|
||||
keys: yubikey_ids,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue