tools/zip: fix doc tests
the doc code was not compiling and blocking cargo test Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
parent
bdc208af48
commit
dc2876f6bb
|
@ -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(())
|
||||
/// }
|
||||
|
|
Loading…
Reference in New Issue