From 1f493bc6521f2a11f9831d2a62200f79758e446c Mon Sep 17 00:00:00 2001 From: Carlos Rolo <3799585+cjrolo@users.noreply.github.com> Date: Thu, 12 Oct 2023 15:06:21 +0100 Subject: [PATCH] Fixed PR confusion --- brro-compressor/src/main.rs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/brro-compressor/src/main.rs b/brro-compressor/src/main.rs index b1fa061..06b32ae 100644 --- a/brro-compressor/src/main.rs +++ b/brro-compressor/src/main.rs @@ -46,14 +46,15 @@ fn process_directory(arguments: &Args) { } /// Processes a single file. -fn process_single_file(path: &Path, arguments: &Args) { - let (vec, tag) = reader::read_file(path).expect("Failed to read file"); +fn process_single_file(arguments: &Args) { + let (vec, tag) = reader::read_file(&arguments.input).expect("Failed to read file"); let compressed_data = compress_data(&vec, &tag, arguments); - if let Some(filename_osstr) = path.file_name() { + if let Some(filename_osstr) = arguments.input.file_name() { if let Some(filename_str) = filename_osstr.to_str() { - let new_filename_string = writer::replace_extension(&filename_str.to_string(), "bin"); - let new_path = path.parent().unwrap().join(new_filename_string); + let new_filename_string = + writer::replace_extension(&filename_str.to_string(), "bin"); + let new_path = arguments.input.parent().unwrap().join(new_filename_string); write_compressed_data_to_path(&compressed_data, &new_path); } }