From f8ffac9100f6f25589c05157478f5facca731b74 Mon Sep 17 00:00:00 2001 From: SpikeHD Date: Sun, 15 May 2022 17:02:54 -0700 Subject: [PATCH] get zip data from zip path --- src-tauri/src/unzip.rs | 33 +++++++-------------------------- 1 file changed, 7 insertions(+), 26 deletions(-) diff --git a/src-tauri/src/unzip.rs b/src-tauri/src/unzip.rs index b922758..e35277f 100644 --- a/src-tauri/src/unzip.rs +++ b/src-tauri/src/unzip.rs @@ -24,30 +24,11 @@ pub fn unzip(zipfile: &str, zippath: &str, destpath: &str) { } }; - // Iterate zip files - for i in 0..zip.len() - { - // Get file - let mut file = match zip.by_index(i) { - Ok(file) => file, - Err(e) => { - println!("Could not open zip file: {}", e); - return; - } - }; - - println!("Filename: {}", file.name()); - - // Read the first byte if it is a file - let first_byte = match file.bytes().next() { - Some(b) => b, - None => { - println!("Could not read first byte of file"); - return; - } - }; - - // Output first byte - println!("{:?}", first_byte); - } + let zipData = match zip.by_name(zippath) { + Ok(zipData) => zipData, + Err(e) => { + println!("Could not find zip file: {}", e); + return; + } + }; } \ No newline at end of file