mirror of
https://github.com/cargo-bins/cargo-binstall.git
synced 2025-05-02 02:00:03 +00:00
Refactor: Simplify untar
with new enum Op
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
parent
b2c34137cc
commit
17fcac7e63
2 changed files with 33 additions and 29 deletions
|
@ -225,8 +225,7 @@ where
|
|||
extract_compressed_from_readable::<DummyVisitor, _>(
|
||||
ReadableRx::new(&mut rx),
|
||||
fmt,
|
||||
&path,
|
||||
None,
|
||||
Op::UnpackToPath(&path),
|
||||
)
|
||||
})
|
||||
.await
|
||||
|
@ -246,12 +245,7 @@ where
|
|||
extract_impl(stream, move |mut rx| {
|
||||
fs::create_dir_all(path.parent().unwrap())?;
|
||||
|
||||
extract_compressed_from_readable(
|
||||
ReadableRx::new(&mut rx),
|
||||
fmt,
|
||||
&*path,
|
||||
Some(&mut visitor),
|
||||
)?;
|
||||
extract_compressed_from_readable(ReadableRx::new(&mut rx), fmt, Op::Visit(&mut visitor))?;
|
||||
|
||||
Ok(visitor)
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue