From cc37f32c28f4fbb1f63d3675f0dc5efda08ad2fd Mon Sep 17 00:00:00 2001 From: v-i-s-h Date: Mon, 4 Jul 2022 14:07:36 +0300 Subject: [PATCH] Correct Result<> --- src/compression/tar/tar-strip-prefix.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/compression/tar/tar-strip-prefix.md b/src/compression/tar/tar-strip-prefix.md index a770871..dd2f0ab 100644 --- a/src/compression/tar/tar-strip-prefix.md +++ b/src/compression/tar/tar-strip-prefix.md @@ -20,7 +20,7 @@ use tar::Archive; # } # } -fn main() -> Result<()> { +fn main() -> Result<(), std::io::Error> { let file = File::open("archive.tar.gz")?; let mut archive = Archive::new(GzDecoder::new(file)); let prefix = "bundle/logs"; @@ -29,7 +29,7 @@ fn main() -> Result<()> { archive .entries()? .filter_map(|e| e.ok()) - .map(|mut entry| -> Result { + .map(|mut entry| -> Result> { let path = entry.path()?.strip_prefix(prefix)?.to_owned(); entry.unpack(&path)?; Ok(path)