clippy: use while let loops
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
This commit is contained in:
parent
09faa9ee95
commit
0d2133db98
@ -343,10 +343,7 @@ fn restore_chunk_archive<'a>(
|
||||
let mut decoder = ChunkArchiveDecoder::new(reader);
|
||||
|
||||
let result: Result<_, Error> = proxmox::try_block!({
|
||||
loop {
|
||||
match decoder.next_chunk()? {
|
||||
Some((digest, blob)) => {
|
||||
|
||||
while let Some((digest, blob)) = decoder.next_chunk()? {
|
||||
if let Some(datastore) = datastore {
|
||||
let chunk_exists = datastore.cond_touch_chunk(&digest, false)?;
|
||||
if !chunk_exists {
|
||||
@ -367,9 +364,6 @@ fn restore_chunk_archive<'a>(
|
||||
}
|
||||
chunks.push(digest);
|
||||
}
|
||||
None => break,
|
||||
}
|
||||
}
|
||||
Ok(())
|
||||
});
|
||||
|
||||
|
@ -134,11 +134,7 @@ impl<I: Send + 'static> ParallelHandler<I> {
|
||||
let mut msg_list = Vec::new();
|
||||
|
||||
let mut i = 0;
|
||||
loop {
|
||||
let handle = match self.handles.pop() {
|
||||
Some(handle) => handle,
|
||||
None => break,
|
||||
};
|
||||
while let Some(handle) = self.handles.pop() {
|
||||
if let Err(panic) = handle.join() {
|
||||
match panic.downcast::<&str>() {
|
||||
Ok(panic_msg) => msg_list.push(
|
||||
|
Loading…
Reference in New Issue
Block a user