all lists on lists.proxmox.com
 help / color / mirror / Atom feed
* [pbs-devel] [PATCH proxmox-backup] tools/zip: fix doc tests
@ 2020-10-21 12:14 Dominik Csapak
  2020-10-21 12:20 ` [pbs-devel] applied: " Thomas Lamprecht
  0 siblings, 1 reply; 2+ messages in thread
From: Dominik Csapak @ 2020-10-21 12:14 UTC (permalink / raw)
  To: pbs-devel

the doc code was not compiling and blocking cargo test

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
 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(())
 /// }
-- 
2.20.1





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-10-21 12:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-21 12:14 [pbs-devel] [PATCH proxmox-backup] tools/zip: fix doc tests Dominik Csapak
2020-10-21 12:20 ` [pbs-devel] applied: " Thomas Lamprecht

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal