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
|
/// ```no_run
|
||||||
/// use proxmox_backup::tools::zip::*;
|
/// use proxmox_backup::tools::zip::*;
|
||||||
/// use tokio::fs::File;
|
/// use tokio::fs::File;
|
||||||
|
/// use tokio::prelude::*;
|
||||||
|
/// use anyhow::{Error, Result};
|
||||||
///
|
///
|
||||||
/// #[tokio::async]
|
/// #[tokio::main]
|
||||||
/// async fn main() -> std::io::Result<()> {
|
/// async fn main() -> Result<(), Error> {
|
||||||
/// let target = File::open("foo.zip").await?;
|
/// let target = File::open("foo.zip").await?;
|
||||||
/// let mut source = File::open("foo.txt").await?;
|
/// let mut source = File::open("foo.txt").await?;
|
||||||
///
|
///
|
||||||
/// let mut zip = ZipEncoder::new(target);
|
/// let mut zip = ZipEncoder::new(target);
|
||||||
/// zip.add_entry(ZipEntry {
|
/// zip.add_entry(ZipEntry::new(
|
||||||
/// "foo.txt",
|
/// "foo.txt",
|
||||||
/// 0,
|
/// 0,
|
||||||
/// 0o100755,
|
/// 0o100755,
|
||||||
/// true,
|
/// true,
|
||||||
/// }, source).await?;
|
/// ), Some(source)).await?;
|
||||||
///
|
///
|
||||||
/// zip.finish().await?
|
/// zip.finish().await?;
|
||||||
///
|
///
|
||||||
/// Ok(())
|
/// Ok(())
|
||||||
/// }
|
/// }
|
||||||
|
|
Loading…
Reference in New Issue