From dc2876f6bbe2552540eb15278e2bd81fa98dd8c4 Mon Sep 17 00:00:00 2001 From: Dominik Csapak Date: Wed, 21 Oct 2020 14:14:22 +0200 Subject: [PATCH] tools/zip: fix doc tests the doc code was not compiling and blocking cargo test Signed-off-by: Dominik Csapak --- src/tools/zip.rs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/tools/zip.rs b/src/tools/zip.rs index 3248239f..d651b092 100644 --- a/src/tools/zip.rs +++ b/src/tools/zip.rs @@ -354,21 +354,23 @@ impl ZipEntry { /// ```no_run /// use proxmox_backup::tools::zip::*; /// use tokio::fs::File; +/// use tokio::prelude::*; +/// use anyhow::{Error, Result}; /// -/// #[tokio::async] -/// async fn main() -> std::io::Result<()> { +/// #[tokio::main] +/// async fn main() -> Result<(), Error> { /// let target = File::open("foo.zip").await?; /// let mut source = File::open("foo.txt").await?; /// /// let mut zip = ZipEncoder::new(target); -/// zip.add_entry(ZipEntry { +/// zip.add_entry(ZipEntry::new( /// "foo.txt", /// 0, /// 0o100755, /// true, -/// }, source).await?; +/// ), Some(source)).await?; /// -/// zip.finish().await? +/// zip.finish().await?; /// /// Ok(()) /// }