Skip to content

Commit 6994b20

Browse files
committed
Migrate to GitQL 0.40.0
1 parent 912459a commit 6994b20

File tree

4 files changed

+63
-51
lines changed

4 files changed

+63
-51
lines changed

Cargo.lock

Lines changed: 46 additions & 33 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ categories = ["command-line-utilities"]
1313
exclude = [".github/**", "docs/**", "media/**", "scripts/**"]
1414

1515
[dependencies]
16-
gitql-core = "0.15.0"
17-
gitql-std = "0.15.0"
18-
gitql-cli = "0.38.0"
19-
gitql-ast = "0.34.0"
20-
gitql-parser = "0.37.0"
21-
gitql-engine = "0.38.0"
16+
gitql-core = "0.17.0"
17+
gitql-std = "0.17.0"
18+
gitql-cli = "0.40.0"
19+
gitql-ast = "0.36.0"
20+
gitql-parser = "0.39.0"
21+
gitql-engine = "0.40.0"
2222
clang-sys = { version = "1.8.1", features = ["clang_18_0"] }
2323
dyn-clone = "1.0.19"
2424

src/arguments.rs

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

5959
if !arg.starts_with('-') {
60-
return Command::Error(format!("Unknown argument {}", arg));
60+
return Command::Error(format!("Unknown argument {arg}"));
6161
}
6262

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

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

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

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

@@ -134,7 +134,7 @@ pub fn parse_arguments(args: &[String]) -> Command {
134134
"--output" | "-o" => {
135135
arg_index += 1;
136136
if arg_index >= args_len {
137-
let message = format!("Argument {} must be followed by output format", arg);
137+
let message = format!("Argument {arg} must be followed by output format");
138138
return Command::Error(message);
139139
}
140140

@@ -152,7 +152,7 @@ pub fn parse_arguments(args: &[String]) -> Command {
152152
}
153153
arg_index += 1;
154154
}
155-
_ => return Command::Error(format!("Unknown command {}", arg)),
155+
_ => return Command::Error(format!("Unknown command {arg}")),
156156
}
157157
}
158158

src/main.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ fn main() {
7474
println!("ClangQ version {}", env!("CARGO_PKG_VERSION"));
7575
}
7676
Command::Error(error_message) => {
77-
println!("{}", error_message);
77+
println!("{error_message}");
7878
}
7979
}
8080
}
@@ -108,7 +108,7 @@ fn launch_clangql_repl(arguments: Arguments) {
108108
}
109109
}
110110
Err(error) => {
111-
reporter.report_diagnostic(&input, Diagnostic::error(&format!("{}", error)));
111+
reporter.report_diagnostic(&input, Diagnostic::error(&format!("{error}")));
112112
}
113113
}
114114

@@ -204,8 +204,7 @@ fn execute_clang_ql_query(
204204
if arguments.analysis {
205205
let total_time = front_duration + engine_duration;
206206
println!(
207-
"{} row in set (total: {:?}, front: {:?}, engine: {:?})",
208-
rows_count, total_time, front_duration, engine_duration
207+
"{rows_count} row in set (total: {total_time:?}, front: {front_duration:?}, engine: {engine_duration:?})",
209208
);
210209
}
211210
}
@@ -214,7 +213,7 @@ fn execute_clang_ql_query(
214213
fn validate_files_paths(files: &[String]) -> Result<(), String> {
215214
for file in files {
216215
if !Path::new(file).exists() {
217-
return Err(format!("File ${} is not exists", file));
216+
return Err(format!("File ${file} is not exists"));
218217
}
219218
}
220219
Ok(())

0 commit comments

Comments
 (0)