Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed PR confusion #45

Merged
merged 1 commit into from
Oct 12, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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