Skip to content

Commit

Permalink
Fixed format and clippy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
devttys0 committed Nov 30, 2024
1 parent 20dbd10 commit 58c3dc3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
7 changes: 3 additions & 4 deletions src/binwalk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ impl BinwalkError {
}
}


/// Analysis results returned by Binwalk::analyze
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct AnalysisResults {
Expand Down Expand Up @@ -145,7 +144,7 @@ impl Binwalk {
if let Some(target_file) = target_file_name {
// Set the target file path, make it an absolute path
match path::absolute(&target_file) {
Err(e) => {
Err(_) => {
return Err(BinwalkError::new(&format!(
"Failed to get absolute path for '{}'",
target_file
Expand All @@ -160,7 +159,7 @@ impl Binwalk {
if let Some(extraction_directory) = output_directory {
// Make the extraction directory an absolute path
match path::absolute(&extraction_directory) {
Err(e) => {
Err(_) => {
return Err(BinwalkError::new(&format!(
"Failed to get absolute path for '{}'",
extraction_directory
Expand All @@ -179,7 +178,7 @@ impl Binwalk {
&new_instance.base_output_directory,
) {
Err(e) => {
return Err(BinwalkError::new( &format!(
return Err(BinwalkError::new(&format!(
"Failed to initialize extraction directory: {}",
e
)));
Expand Down
9 changes: 7 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,19 @@ fn main() {
}

// Initialize binwalk
let binwalker = binwalk::Binwalk::configure(
let binwalker = match binwalk::Binwalk::configure(
cliargs.file_name,
output_directory,
cliargs.include,
cliargs.exclude,
None,
cliargs.search_all,
).expect("Binwalk initialization failed");
) {
Err(e) => {
panic!("Binwalk initialization failed: {}", e.message);
}
Ok(bw) => bw,
};

// If the user specified --threads, honor that request; else, auto-detect available parallelism
let available_workers = cliargs.threads.unwrap_or_else(|| {
Expand Down

0 comments on commit 58c3dc3

Please sign in to comment.