mirror of
https://git.proxmox.com/git/proxmox
synced 2025-07-17 17:50:49 +00:00
[clippy] api-test: simplify some loops
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
parent
adf6727072
commit
dffed98348
@ -63,11 +63,8 @@ impl<'de> serde::de::Visitor<'de> for StringListVisitor {
|
||||
|
||||
fn visit_seq<A: serde::de::SeqAccess<'de>>(self, mut seq: A) -> Result<Self::Value, A::Error> {
|
||||
let mut out = seq.size_hint().map_or_else(Vec::new, Vec::with_capacity);
|
||||
loop {
|
||||
match seq.next_element::<String>()? {
|
||||
Some(el) => out.push(el),
|
||||
None => break,
|
||||
}
|
||||
while let Some(el) = seq.next_element::<String>()? {
|
||||
out.push(el);
|
||||
}
|
||||
Ok(out)
|
||||
}
|
||||
|
@ -70,11 +70,8 @@ impl<'de> serde::de::Visitor<'de> for StringSetVisitor {
|
||||
let mut out = seq
|
||||
.size_hint()
|
||||
.map_or_else(HashSet::new, HashSet::with_capacity);
|
||||
loop {
|
||||
match seq.next_element::<String>()? {
|
||||
Some(el) => out.insert(el),
|
||||
None => break,
|
||||
};
|
||||
while let Some(el) = seq.next_element::<String>()? {
|
||||
out.insert(el);
|
||||
}
|
||||
Ok(out)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user