[pbs-devel] [PATCH pxar 1/2] fix example

Fabian Grünbichler f.gruenbichler at proxmox.com
Thu Jan 14 14:41:41 CET 2021


From: Wolfgang Bumiller <w.bumiller at proxmox.com>

Signed-off-by: Wolfgang Bumiller <w.bumiller at proxmox.com>
---
 examples/apxar.rs | 15 +--------------
 1 file changed, 1 insertion(+), 14 deletions(-)

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());
     }
 }
-- 
2.20.1






More information about the pbs-devel mailing list