From 9cc9a0284a15293421d2733b3fe4191ac72b680c Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Tue, 28 Dec 2021 10:59:17 +0800 Subject: [PATCH] nac3standalone: style --- nac3standalone/src/main.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nac3standalone/src/main.rs b/nac3standalone/src/main.rs index 51520cba..702c03ad 100644 --- a/nac3standalone/src/main.rs +++ b/nac3standalone/src/main.rs @@ -25,7 +25,7 @@ mod basic_symbol_resolver; use basic_symbol_resolver::*; fn main() { - let demo_name = env::args().nth(1).unwrap(); + let file_name = env::args().nth(1).unwrap() + ".py"; let threads: u32 = env::args() .nth(2) .map(|s| str::parse(&s).unwrap()) @@ -35,7 +35,7 @@ fn main() { Target::initialize_all(&InitializationConfig::default()); - let program = match fs::read_to_string(demo_name.clone() + ".py") { + let program = match fs::read_to_string(file_name.clone()) { Ok(program) => program, Err(err) => { println!("Cannot open input file: {}", err); @@ -64,7 +64,7 @@ fn main() { setup_time.duration_since(start).unwrap().as_millis() ); - let parser_result = parser::parse_program(&program, format!("{}.py", demo_name).into()).unwrap(); + let parser_result = parser::parse_program(&program, file_name.into()).unwrap(); let parse_time = SystemTime::now(); println!( "parse time: {}ms",