improvements

This commit is contained in:
alexpasmantier 2024-10-10 12:44:59 +02:00
parent 95607a1d4f
commit 38ec6386b7
2 changed files with 4 additions and 4 deletions

View File

@ -70,7 +70,7 @@ pub fn main() -> Result<(), GGError> {
printer.wipeout()?;
}
Err(err) => {
eprintln!("Error: {}", err);
eprintln!("Error: {err}");
}
}
return Ok(());
@ -78,7 +78,7 @@ pub fn main() -> Result<(), GGError> {
}
let haystack_builder = walk_builder(
cli_args.paths.iter().map(|p| p.as_path()).collect(),
cli_args.paths.iter().map(PathBuf::as_path).collect(),
&cli_args.ignored_paths,
cli_args.n_threads,
!cli_args.disregard_gitignore,
@ -110,7 +110,7 @@ pub fn main() -> Result<(), GGError> {
ignore::WalkState::Continue
}
Err(err) => {
eprintln!("Error: {}", err);
eprintln!("Error: {err}");
ignore::WalkState::Continue
}
})

View File

@ -107,7 +107,7 @@ impl ResultsPrinter {
match self.config.mode {
PrintMode::Text => self.write_colored_text_results(&results.path, results.results),
PrintMode::Json => self.writeln_to_buffer(serde_json::to_string(&FileResults {
path: results.path.to_path_buf(),
path: results.path.clone(),
results: results.results,
})?),
PrintMode::Files => self.write_colored_path(&results.path),