Skip to content

Commit

Permalink
Merge pull request #45 from instaclustr/merge-fix
Browse files Browse the repository at this point in the history
Fixed PR confusion
  • Loading branch information
joshuabvarghese authored Oct 12, 2023
2 parents bba5ded + 1f493bc commit cd09030
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions brro-compressor/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down

0 comments on commit cd09030

Please sign in to comment.