From 26aeb75bd1c6d002b9dc0af5cce3d66ac9f11204 Mon Sep 17 00:00:00 2001 From: Mystikfluu Date: Sun, 15 Jan 2023 13:15:34 +0100 Subject: [PATCH] change location to file path Co-authored-by: Alpisc --- src/lib.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 4f57058..b9f0871 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -27,10 +27,10 @@ pub fn get_args() -> Vec { // todo!("Get request"); // } -pub fn import_file(location:&String) -> bool { - if std::path::Path::new(&(location.clone()+"/export.ipassx")).exists() { +pub fn import_file(file_path:&String) -> bool { + if std::path::Path::new(file_path).exists() { let mut reader = brotli::Decompressor::new( - File::open(location.clone()+"/export.ipassx").unwrap(), + File::open(file_path).unwrap(), 4096, // buffer size ); let mut content: String = String::new(); @@ -70,7 +70,7 @@ pub fn import_file(location:&String) -> bool { } } -pub fn export_file(location:&String) -> bool { +pub fn export_file(file_path:&String) -> bool { let mut collected_data: String = String::new(); let paths = read_dir(get_ipass_folder()).unwrap(); @@ -82,7 +82,7 @@ pub fn export_file(location:&String) -> bool { } } - if let Ok(file) = File::create(location.clone()+"/export.ipassx") { + if let Ok(file) = File::create(file_path) { let mut writer = brotli::CompressorWriter::new( file, 4096,