newreg: mostly var name changes

This commit is contained in:
theubusu
2026-02-05 18:53:35 +01:00
parent 1aaf2f4b0f
commit 59f24f5802
31 changed files with 155 additions and 147 deletions
+4 -4
View File
@@ -14,7 +14,7 @@ struct Args {
output_folder: Option<String>,
}
pub struct ProgramContext<'a> {
pub struct AppContext<'a> {
pub file: &'a std::fs::File,
pub output_dir: &'a str,
}
@@ -47,13 +47,13 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
}
let file = File::open(path)?;
let program_context: ProgramContext = ProgramContext { file: &file, output_dir: &output_path };
let app_ctx: AppContext = AppContext { file: &file, output_dir: &output_path };
let formats: Vec<Format> = get_registry();
for format in formats {
if let Some(ctx) = (format.detect_func)(&program_context)? {
if let Some(ctx) = (format.detector_func)(&app_ctx)? {
println!("{} detected!", format.name);
(format.run_func)(&program_context, Some(ctx))?;
(format.extractor_func)(&app_ctx, Some(ctx))?;
return Ok(());
}
}