diff --git a/src/repository/extract.rs b/src/repository/extract.rs index 2c33776..2dd85f4 100644 --- a/src/repository/extract.rs +++ b/src/repository/extract.rs @@ -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 = Result; /// 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(); diff --git a/src/utils.rs b/src/utils.rs index 3c5c0e5..d99c4d4 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -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(