Skip to content

Commit 276c37e

Browse files
committed
clippy
1 parent 83b65be commit 276c37e

File tree

4 files changed

+29
-29
lines changed

4 files changed

+29
-29
lines changed

crates/uniffi/src/bin/uniffi-bindgen-cpp.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,21 +61,21 @@ fn main() {
6161
Utf8PathBuf::from(positional_args.get(1).map(|s| s.as_str()).unwrap_or(default_out));
6262

6363
if !udl_path.exists() {
64-
eprintln!("Error: UDL file not found: {}", udl_path);
64+
eprintln!("Error: UDL file not found: {udl_path}");
6565
eprintln!();
6666
eprintln!("Hint: Run with --help to see usage information");
6767
process::exit(1);
6868
}
6969

7070
// Create output directory if it doesn't exist
7171
if let Err(e) = std::fs::create_dir_all(&out_dir) {
72-
eprintln!("Error: Failed to create output directory {}: {}", out_dir, e);
72+
eprintln!("Error: Failed to create output directory {out_dir}: {e}");
7373
process::exit(1);
7474
}
7575

7676
println!("Generating C++ bindings for Dojo...");
77-
println!("UDL file: {}", udl_path);
78-
println!("Output: {}", out_dir);
77+
println!("UDL file: {udl_path}");
78+
println!("Output: {out_dir}");
7979

8080
// Build command for uniffi-bindgen-cpp
8181
let mut cmd = process::Command::new("uniffi-bindgen-cpp");
@@ -104,7 +104,7 @@ fn main() {
104104
Ok(output) => {
105105
if output.status.success() {
106106
println!("✓ C++ bindings generated successfully!");
107-
println!("\nGenerated files in {}:", out_dir);
107+
println!("\nGenerated files in {out_dir}:");
108108
println!(" - dojo.hpp (C++ header)");
109109
println!(" - dojo.cpp (C++ implementation)");
110110
println!(" - dojo_scaffolding.hpp (FFI scaffolding)");
@@ -129,7 +129,7 @@ fn main() {
129129
}
130130
}
131131
Err(e) => {
132-
eprintln!("Error executing uniffi-bindgen-cpp: {}", e);
132+
eprintln!("Error executing uniffi-bindgen-cpp: {e}");
133133
eprintln!("\nMake sure uniffi-bindgen-cpp is installed and in your PATH");
134134
process::exit(1);
135135
}

crates/uniffi/src/bin/uniffi-bindgen-csharp.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ fn main() {
6262
};
6363

6464
// Default paths (must match the library output name)
65-
let default_lib = format!("target/release/libdojo_uniffi.{}", lib_ext);
65+
let default_lib = format!("target/release/libdojo_uniffi.{lib_ext}");
6666
let default_out = "bindings/csharp";
6767

6868
// Parse arguments
@@ -75,7 +75,7 @@ fn main() {
7575
Utf8PathBuf::from(positional_args.get(1).map(|s| s.as_str()).unwrap_or(default_out));
7676

7777
if !library_path.exists() {
78-
eprintln!("Error: Library file not found: {}", library_path);
78+
eprintln!("Error: Library file not found: {library_path}");
7979
eprintln!("Build the library first with: cargo build --release -p dojo-uniffi");
8080
eprintln!();
8181
eprintln!("Hint: Run with --help to see usage information");
@@ -84,13 +84,13 @@ fn main() {
8484

8585
// Create output directory if it doesn't exist
8686
if let Err(e) = std::fs::create_dir_all(&out_dir) {
87-
eprintln!("Error: Failed to create output directory {}: {}", out_dir, e);
87+
eprintln!("Error: Failed to create output directory {out_dir}: {e}");
8888
process::exit(1);
8989
}
9090

9191
println!("Generating C# bindings...");
92-
println!("Library: {}", library_path);
93-
println!("Output: {}", out_dir);
92+
println!("Library: {library_path}");
93+
println!("Output: {out_dir}");
9494

9595
// Build command for uniffi-bindgen-cs
9696
let mut cmd = process::Command::new("uniffi-bindgen-cs");
@@ -132,7 +132,7 @@ fn main() {
132132
}
133133
}
134134
Err(e) => {
135-
eprintln!("Error executing uniffi-bindgen-cs: {}", e);
135+
eprintln!("Error executing uniffi-bindgen-cs: {e}");
136136
process::exit(1);
137137
}
138138
}

crates/uniffi/src/bin/uniffi-bindgen-kotlin.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ fn main() {
3838
};
3939

4040
// Default paths (must match the library output name)
41-
let default_lib = format!("target/release/libdojo_uniffi.{}", lib_ext);
41+
let default_lib = format!("target/release/libdojo_uniffi.{lib_ext}");
4242
let default_out = "bindings/kotlin";
4343

4444
// Parse arguments
@@ -51,7 +51,7 @@ fn main() {
5151
Utf8PathBuf::from(positional_args.get(1).map(|s| s.as_str()).unwrap_or(default_out));
5252

5353
if !library_path.exists() {
54-
eprintln!("Error: Library file not found: {}", library_path);
54+
eprintln!("Error: Library file not found: {library_path}");
5555
eprintln!("Build the library first with: cargo build --release -p dojo-uniffi");
5656
eprintln!();
5757
eprintln!("Hint: Run with --help to see usage information");
@@ -60,20 +60,20 @@ fn main() {
6060

6161
// Create output directory if it doesn't exist
6262
if let Err(e) = fs::create_dir_all(&out_dir) {
63-
eprintln!("Error: Failed to create output directory {}: {}", out_dir, e);
63+
eprintln!("Error: Failed to create output directory {out_dir}: {e}");
6464
process::exit(1);
6565
}
6666

6767
println!("Generating Kotlin bindings...");
68-
println!("Library: {}", library_path);
69-
println!("Output: {}", out_dir);
68+
println!("Library: {library_path}");
69+
println!("Output: {out_dir}");
7070

7171
match generate_kotlin_bindings(&library_path, &out_dir) {
7272
Ok(_) => {
7373
println!("✓ Kotlin bindings generated successfully!");
7474
}
7575
Err(e) => {
76-
eprintln!("Error generating bindings: {}", e);
76+
eprintln!("Error generating bindings: {e}");
7777
process::exit(1);
7878
}
7979
}
@@ -89,7 +89,7 @@ fn generate_kotlin_bindings(
8989
// Get cargo metadata for config
9090
let metadata = cargo_metadata::MetadataCommand::new()
9191
.exec()
92-
.map_err(|e| anyhow::anyhow!("Failed to get cargo metadata: {}", e))?;
92+
.map_err(|e| anyhow::anyhow!("Failed to get cargo metadata: {e}"))?;
9393

9494
let config_supplier = CrateConfigSupplier::from(metadata);
9595

crates/uniffi/src/bin/uniffi-bindgen-python.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ fn main() {
4040
};
4141

4242
// Default paths (must match the library output name)
43-
let default_lib = format!("target/release/libdojo_uniffi.{}", lib_ext);
43+
let default_lib = format!("target/release/libdojo_uniffi.{lib_ext}");
4444
let default_out = "bindings/python";
4545

4646
// Parse arguments
@@ -53,7 +53,7 @@ fn main() {
5353
Utf8PathBuf::from(positional_args.get(1).map(|s| s.as_str()).unwrap_or(default_out));
5454

5555
if !library_path.exists() {
56-
eprintln!("Error: Library file not found: {}", library_path);
56+
eprintln!("Error: Library file not found: {library_path}");
5757
eprintln!("Build the library first with: cargo build --release -p dojo-uniffi");
5858
eprintln!();
5959
eprintln!("Hint: Run with --help to see usage information");
@@ -62,25 +62,25 @@ fn main() {
6262

6363
// Create output directory if it doesn't exist
6464
if let Err(e) = std::fs::create_dir_all(&out_dir) {
65-
eprintln!("Error: Failed to create output directory {}: {}", out_dir, e);
65+
eprintln!("Error: Failed to create output directory {out_dir}: {e}");
6666
process::exit(1);
6767
}
6868

6969
println!("Generating Python bindings...");
70-
println!("Library: {}", library_path);
71-
println!("Output: {}", out_dir);
70+
println!("Library: {library_path}");
71+
println!("Output: {out_dir}");
7272

7373
// Find uniffi.toml config file
7474
let config_file = Utf8PathBuf::from("crates/uniffi/uniffi.toml");
7575
if !config_file.exists() {
76-
eprintln!("Warning: uniffi.toml not found at {}", config_file);
76+
eprintln!("Warning: uniffi.toml not found at {config_file}");
7777
}
7878

7979
// Use cargo metadata to get crate configuration
8080
let metadata = match cargo_metadata::MetadataCommand::new().exec() {
8181
Ok(m) => m,
8282
Err(e) => {
83-
eprintln!("Error getting cargo metadata: {}", e);
83+
eprintln!("Error getting cargo metadata: {e}");
8484
eprintln!("Make sure you're running this from a cargo project directory");
8585
process::exit(1);
8686
}
@@ -91,15 +91,15 @@ fn main() {
9191
match Root::from_library(config_supplier, &library_path, Some(config_file.to_string())) {
9292
Ok(root) => match run_pipeline(root, &out_dir) {
9393
Ok(_) => {
94-
println!("✓ Python bindings generated successfully in {}", out_dir);
94+
println!("✓ Python bindings generated successfully in {out_dir}");
9595
}
9696
Err(e) => {
97-
eprintln!("Error generating Python bindings: {}", e);
97+
eprintln!("Error generating Python bindings: {e}");
9898
process::exit(1);
9999
}
100100
},
101101
Err(e) => {
102-
eprintln!("Error loading library metadata: {}", e);
102+
eprintln!("Error loading library metadata: {e}");
103103
process::exit(1);
104104
}
105105
}

0 commit comments

Comments
 (0)