Skip to content

Commit cdd72da

Browse files
committed
Make clippy happy
1 parent 5c688c2 commit cdd72da

3 files changed

Lines changed: 12 additions & 12 deletions

File tree

crates/analyzer/src/traversal/expressions.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1381,7 +1381,7 @@ fn expr_call_pure(
13811381

13821382
if function.is_test(context.db()) {
13831383
context.fancy_error(
1384-
&format!("`{}` is a test function", fn_name),
1384+
&format!("`{fn_name}` is a test function"),
13851385
vec![Label::primary(call_span, "test functions are not callable")],
13861386
vec![],
13871387
);

crates/fe/src/task/test.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ pub fn test(args: TestArgs) {
2626
test_ingot(&args)
2727
};
2828

29-
println!("{}", test_sink);
29+
println!("{test_sink}");
3030
if test_sink.failure_count() != 0 {
3131
std::process::exit(1)
3232
}
@@ -38,7 +38,7 @@ fn test_single_file(args: &TestArgs) -> TestSink {
3838
let mut db = fe_driver::Db::default();
3939
let content = match std::fs::read_to_string(input_path) {
4040
Err(err) => {
41-
eprintln!("Failed to load file: `{}`. Error: {}", input_path, err);
41+
eprintln!("Failed to load file: `{input_path}`. Error: {err}");
4242
std::process::exit(1)
4343
}
4444
Ok(content) => content,
@@ -51,7 +51,7 @@ fn test_single_file(args: &TestArgs) -> TestSink {
5151
sink
5252
}
5353
Err(error) => {
54-
eprintln!("Unable to compile {}.", input_path);
54+
eprintln!("Unable to compile {input_path}.");
5555
print_diagnostics(&db, &error.0);
5656
std::process::exit(1)
5757
}
@@ -60,7 +60,7 @@ fn test_single_file(args: &TestArgs) -> TestSink {
6060

6161
pub fn execute_tests(module_name: &str, tests: &[CompiledTest], sink: &mut TestSink) {
6262
if tests.len() == 1 {
63-
println!("executing 1 test in {}:", module_name);
63+
println!("executing 1 test in {module_name}:");
6464
} else {
6565
println!("executing {} tests in {}:", tests.len(), module_name);
6666
}
@@ -83,18 +83,18 @@ fn test_ingot(args: &TestArgs) -> TestSink {
8383
let optimize = args.optimize.unwrap_or(true);
8484

8585
if !Path::new(input_path).exists() {
86-
eprintln!("Input directory does not exist: `{}`.", input_path);
86+
eprintln!("Input directory does not exist: `{input_path}`.");
8787
std::process::exit(1)
8888
}
8989

9090
let content = match load_files_from_dir(input_path) {
9191
Ok(files) if files.is_empty() => {
92-
eprintln!("Input directory is not an ingot: `{}`", input_path);
92+
eprintln!("Input directory is not an ingot: `{input_path}`");
9393
std::process::exit(1)
9494
}
9595
Ok(files) => files,
9696
Err(err) => {
97-
eprintln!("Failed to load project files. Error: {}", err);
97+
eprintln!("Failed to load project files. Error: {err}");
9898
std::process::exit(1)
9999
}
100100
};
@@ -110,7 +110,7 @@ fn test_ingot(args: &TestArgs) -> TestSink {
110110
sink
111111
}
112112
Err(error) => {
113-
eprintln!("Unable to compile {}.", input_path);
113+
eprintln!("Unable to compile {input_path}.");
114114
print_diagnostics(&db, &error.0);
115115
std::process::exit(1)
116116
}

crates/test-runner/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ impl Display for TestSink {
4848

4949
let test_description = |n: usize, status: &dyn Display| -> String {
5050
if n == 1 {
51-
format!("1 test {}", status)
51+
format!("1 test {status}")
5252
} else {
53-
format!("{} tests {}", n, status)
53+
format!("{n} tests {status}")
5454
}
5555
};
5656

@@ -85,7 +85,7 @@ pub fn execute(name: &str, bytecode: &str, sink: &mut TestSink) -> bool {
8585
if reverted {
8686
sink.inc_success_count();
8787
} else {
88-
sink.insert_failure(name, &format!("{:?}", result));
88+
sink.insert_failure(name, &format!("{result:?}"));
8989
};
9090

9191
reverted

0 commit comments

Comments
 (0)