From: Wolfgang Bumiller Date: Wed, 13 Jan 2021 08:59:58 +0000 (+0100) Subject: fix example X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=a5b958d10c63e4c27b69f821725d60e9e6d35a2e;p=pxar.git fix example Signed-off-by: Wolfgang Bumiller --- diff --git a/examples/apxar.rs b/examples/apxar.rs index 03c7590..0c62242 100644 --- a/examples/apxar.rs +++ b/examples/apxar.rs @@ -12,21 +12,8 @@ async fn main() { let mut reader = Decoder::from_tokio(file) .await .expect("failed to open pxar archive contents"); - let mut i = 0; - while let Some(entry) = reader.next().await { - println!("{:#?}", entry.expect("failed to parse entry").path()); - i += 1; - if i == 2 { - break; - } - } - // Use a Stream for the remaining entries: - use futures::stream::StreamExt; - - let mut stream = reader.into_stream(); - - while let Some(entry) = stream.next().await { + while let Some(entry) = reader.next().await { println!("{:#?}", entry.expect("failed to parse entry").path()); } }