Skip to content

Commit 4500c61

Browse files
committed
Migrate to latset rust version
1 parent c2cd101 commit 4500c61

File tree

2 files changed

+12
-13
lines changed

2 files changed

+12
-13
lines changed

src/arguments.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,14 @@ pub fn parse_arguments(args: &[String]) -> Command {
5959
let arg = &args[arg_index];
6060

6161
if !arg.starts_with('-') {
62-
return Command::Error(format!("Unknown argument {}", arg));
62+
return Command::Error(format!("Unknown argument {arg}"));
6363
}
6464

6565
match arg.as_ref() {
6666
"--files" | "-f" => {
6767
arg_index += 1;
6868
if arg_index >= args_len {
69-
let message = format!("Argument {} must be followed by one or more path", arg);
69+
let message = format!("Argument {arg} must be followed by one or more path");
7070
return Command::Error(message);
7171
}
7272

@@ -92,7 +92,7 @@ pub fn parse_arguments(args: &[String]) -> Command {
9292
"--query" | "-q" => {
9393
arg_index += 1;
9494
if arg_index >= args_len {
95-
let message = format!("Argument {} must be followed by the query", arg);
95+
let message = format!("Argument {arg} must be followed by the query");
9696
return Command::Error(message);
9797
}
9898

@@ -102,7 +102,7 @@ pub fn parse_arguments(args: &[String]) -> Command {
102102
"--script" | "-s" => {
103103
arg_index += 1;
104104
if arg_index >= args_len {
105-
let message = format!("Argument {} must be followed by the file", arg);
105+
let message = format!("Argument {arg} must be followed by the file");
106106
return Command::Error(message);
107107
}
108108

@@ -120,7 +120,7 @@ pub fn parse_arguments(args: &[String]) -> Command {
120120
"--pagesize" | "-ps" => {
121121
arg_index += 1;
122122
if arg_index >= args_len {
123-
let message = format!("Argument {} must be followed by the page size", arg);
123+
let message = format!("Argument {arg} must be followed by the page size");
124124
return Command::Error(message);
125125
}
126126

@@ -140,7 +140,7 @@ pub fn parse_arguments(args: &[String]) -> Command {
140140
"--output" | "-o" => {
141141
arg_index += 1;
142142
if arg_index >= args_len {
143-
let message = format!("Argument {} must be followed by output format", arg);
143+
let message = format!("Argument {arg} must be followed by output format");
144144
return Command::Error(message);
145145
}
146146

@@ -159,7 +159,7 @@ pub fn parse_arguments(args: &[String]) -> Command {
159159

160160
arg_index += 1;
161161
}
162-
_ => return Command::Error(format!("Unknown command {}", arg)),
162+
_ => return Command::Error(format!("Unknown command {arg}")),
163163
}
164164
}
165165

src/main.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ fn main() {
9696
println!("LLQL version {}", env!("CARGO_PKG_VERSION"));
9797
}
9898
Command::Error(error_message) => {
99-
println!("{}", error_message);
99+
println!("{error_message}");
100100
std::process::exit(1);
101101
}
102102
}
@@ -165,7 +165,7 @@ fn launch_llql_repl(arguments: &Arguments) {
165165
}
166166
}
167167
Err(error) => {
168-
reporter.report_diagnostic(&input, Diagnostic::error(&format!("{}", error)));
168+
reporter.report_diagnostic(&input, Diagnostic::error(&format!("{error}")));
169169
}
170170
}
171171

@@ -258,8 +258,7 @@ fn execute_llql_query(
258258
if arguments.analysis {
259259
let total_time = front_duration + engine_duration;
260260
println!(
261-
"{} row in set (total: {:?}, front: {:?}, engine: {:?})",
262-
rows_count, total_time, front_duration, engine_duration
261+
"{rows_count} row in set (total: {total_time:?}, front: {front_duration:?}, engine: {engine_duration:?})"
263262
);
264263
}
265264
}
@@ -268,14 +267,14 @@ fn execute_llql_query(
268267
fn validate_files_paths(files: &[String]) -> Result<(), String> {
269268
for file in files {
270269
if !Path::new(file).exists() {
271-
return Err(format!("File ${} is not exists", file));
270+
return Err(format!("File ${file} is not exists"));
272271
}
273272

274273
if file.ends_with(".ll") || file.ends_with(".bc") {
275274
continue;
276275
}
277276

278-
return Err(format!("File ${} must end with LL or BC extension", file));
277+
return Err(format!("File ${file} must end with LL or BC extension"));
279278
}
280279
Ok(())
281280
}

0 commit comments

Comments
 (0)