Fix warnings on windows build

feature/lookup-installed
trivernis 1 year ago
parent 621f599e32
commit 3c09130d91
Signed by: Trivernis
GPG Key ID: DFFFCC2C7A02DB45

@ -1,14 +1,9 @@
use std::{
fs::File,
io::{self, BufReader},
path::Path,
};
use std::{fs::File, io, path::Path};
use miette::Diagnostic;
use miette::Result;
use thiserror::Error;
use crate::utils::progress_spinner;
type ExtractResult<T> = Result<T, ExtractError>;
/// An error that can occur during extraction
@ -34,10 +29,11 @@ pub fn extract_file(src: &Path, dst: &Path) -> ExtractResult<()> {
#[cfg(not(target_os = "windows"))]
fn extract_tar_gz(src: &Path, dst: &Path) -> ExtractResult<()> {
use crate::utils::progress_spinner;
use libflate::gzip::Decoder;
use tar::Archive;
let reader = BufReader::new(File::open(src)?);
let reader = io::BufReader::new(File::open(src)?);
let decoder = Decoder::new(reader)?;
let mut archive = Archive::new(decoder);
let pb = progress_spinner();

@ -15,6 +15,7 @@ pub fn progress_bar(total: u64) -> ProgressBar {
pb
}
#[cfg(not(target_os = "windows"))]
pub fn progress_spinner() -> ProgressBar {
let pb = ProgressBar::new_spinner();
pb.set_style(

Loading…
Cancel
Save