Skip to content

Commit

Permalink
fix: remove the print
Browse files Browse the repository at this point in the history
  • Loading branch information
moz-sec committed Jul 9, 2024
1 parent 471c263 commit 40ae5d1
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 11 deletions.
1 change: 0 additions & 1 deletion src/archiver/zip.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ fn dir_archive<W: Write + Seek>(
options: SimpleFileOptions,
) -> Result<(), Box<dyn Error>> {
for entry in target.read_dir()? {
println!("{:?}", entry);
match entry {
Ok(directory) => {
let files = directory.path();
Expand Down
2 changes: 0 additions & 2 deletions src/extractor/zip.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,9 @@ pub(super) struct ZipExtractor {}

impl Extractor for ZipExtractor {
fn perform(&self, archive_file: PathBuf, opts: &ExtractorOpts) -> Result<(), Box<dyn Error>> {
println!("Extracting {:?}", archive_file);
let zip_file = File::open(&archive_file).unwrap();
let mut zip = zip::ZipArchive::new(zip_file).unwrap();
let dest_base = opts.destination(&archive_file);
println!("Extracting to {:?}", dest_base);
for i in 0..zip.len() {
let mut file = zip.by_index(i).unwrap();
if file.is_file() {
Expand Down
9 changes: 1 addition & 8 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ fn main() -> Result<(), Box<dyn Error>> {
}

fn run(args: cli::CliArgs) -> Result<(), Box<dyn Error>> {
println!("{:#?}", args);
// println!("{:#?}", args);
if args.decompress {
perform_extract(args)?;
} else {
Expand All @@ -37,14 +37,7 @@ fn perform_archive(opts: cli::CliArgs) -> Result<(), Box<dyn Error>> {

fn perform_extract(args: cli::CliArgs) -> Result<(), Box<dyn Error>> {
let extract_opts = extractor::ExtractorOpts::new(&args);
println!("{:?}", extract_opts);
// for arg in args.files.iter() {
// let extractor = extractor::create_extractor(arg).unwrap();
// let target = arg.to_path_buf();
// }
// Ok(())
let file = args.files.first().unwrap();
println!("{:?}", file);
match extractor::create_extractor(file) {
Ok(extractor) => extractor.perform(file.to_path_buf(), &extract_opts),
Err(_) => Err("An error occurred during archiving".into()),
Expand Down

0 comments on commit 40ae5d1

Please sign in to comment.