diff --git a/proxmox-tfa/src/api/mod.rs b/proxmox-tfa/src/api/mod.rs index f7aeea5a..16444f17 100644 --- a/proxmox-tfa/src/api/mod.rs +++ b/proxmox-tfa/src/api/mod.rs @@ -1352,7 +1352,7 @@ where let expire_before = proxmox_time::epoch_i64() - CHALLENGE_TIMEOUT_SECS; deserializer.deserialize_seq(serde_tools::fold( "a challenge entry", - |cap| cap.map(Vec::with_capacity).unwrap_or_else(Vec::new), + |cap| cap.map(Vec::with_capacity).unwrap_or_default(), move |out, reg: T| { if !reg.is_expired(expire_before) { out.push(reg); diff --git a/proxmox-tfa/src/api/serde_tools.rs b/proxmox-tfa/src/api/serde_tools.rs index 8fbe0fc2..206128bd 100644 --- a/proxmox-tfa/src/api/serde_tools.rs +++ b/proxmox-tfa/src/api/serde_tools.rs @@ -83,7 +83,7 @@ where /// { /// deserializer.deserialize_seq(proxmox_serde::fold( /// "a sequence of integers", -/// |cap| cap.map(Vec::with_capacity).unwrap_or_else(Vec::new), +/// |cap| cap.map(Vec::with_capacity).unwrap_or_default(), /// |out, num: u64| { /// if num != 4 { /// out.push(num.to_string());