mirror of
https://github.com/cargo-bins/cargo-binstall.git
synced 2025-04-21 04:58:42 +00:00
Simplify create_tar_decoder
: Ret io::Result
instead of `Result<Archive, BinstallError>` Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
parent
0480e99460
commit
1161a60968
1 changed files with 2 additions and 2 deletions
|
@ -1,5 +1,5 @@
|
|||
use std::fs::File;
|
||||
use std::io::{BufRead, Read};
|
||||
use std::io::{self, BufRead, Read};
|
||||
use std::path::Path;
|
||||
|
||||
use flate2::bufread::GzDecoder;
|
||||
|
@ -14,7 +14,7 @@ use crate::{BinstallError, TarBasedFmt};
|
|||
pub(super) fn create_tar_decoder(
|
||||
dat: impl BufRead + 'static,
|
||||
fmt: TarBasedFmt,
|
||||
) -> Result<Archive<Box<dyn Read>>, BinstallError> {
|
||||
) -> io::Result<Archive<Box<dyn Read>>> {
|
||||
use TarBasedFmt::*;
|
||||
|
||||
let r: Box<dyn Read> = match fmt {
|
||||
|
|
Loading…
Add table
Reference in a new issue