Fix warnings on windows build

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

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

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

Loading…
Cancel
Save