Skip to content

Commit fa7a71d

Browse files
authored
Correct Result<> (#669)
1 parent cc8767b commit fa7a71d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/compression/tar/tar-strip-prefix.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ use tar::Archive;
2020
# }
2121
# }
2222
23-
fn main() -> Result<()> {
23+
fn main() -> Result<(), std::io::Error> {
2424
let file = File::open("archive.tar.gz")?;
2525
let mut archive = Archive::new(GzDecoder::new(file));
2626
let prefix = "bundle/logs";
@@ -29,7 +29,7 @@ fn main() -> Result<()> {
2929
archive
3030
.entries()?
3131
.filter_map(|e| e.ok())
32-
.map(|mut entry| -> Result<PathBuf> {
32+
.map(|mut entry| -> Result<PathBuf, Box<dyn std::error::Error>> {
3333
let path = entry.path()?.strip_prefix(prefix)?.to_owned();
3434
entry.unpack(&path)?;
3535
Ok(path)

0 commit comments

Comments
 (0)