Skip to content

Commit 83b65be

Browse files
committed
choree: format strings
1 parent 873423a commit 83b65be

File tree

3 files changed

+24
-26
lines changed

3 files changed

+24
-26
lines changed

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

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

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

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

7979
println!("Generating Go bindings...");
80-
println!("UDL file: {}", udl_path);
81-
println!("Output: {}", out_dir);
80+
println!("UDL file: {udl_path}");
81+
println!("Output: {out_dir}");
8282

8383
// Build command for uniffi-bindgen-go
8484
let mut cmd = process::Command::new("uniffi-bindgen-go");
@@ -122,17 +122,17 @@ fn main() {
122122
let dojo_dir = udl_dir.join("dojo"); // namespace is "dojo"
123123

124124
if dojo_dir.exists() {
125-
println!("\nCopying generated files to {}...", out_dir);
125+
println!("\nCopying generated files to {out_dir}...");
126126
if let Err(e) = copy_dir_recursive(&dojo_dir, &out_dir) {
127-
eprintln!("Warning: Failed to copy files: {}", e);
128-
eprintln!("You may need to manually copy files from {}", dojo_dir);
127+
eprintln!("Warning: Failed to copy files: {e}");
128+
eprintln!("You may need to manually copy files from {dojo_dir}");
129129
} else {
130-
println!("✓ Files copied to {}", out_dir);
130+
println!("✓ Files copied to {out_dir}");
131131
// Clean up the generated directory in src
132132
let _ = std::fs::remove_dir_all(&dojo_dir);
133133
}
134134
} else {
135-
eprintln!("Warning: Generated Go files not found at {}", dojo_dir);
135+
eprintln!("Warning: Generated Go files not found at {dojo_dir}");
136136
eprintln!("They may be in a different location.");
137137
}
138138
} else {
@@ -144,7 +144,7 @@ fn main() {
144144
}
145145
}
146146
Err(e) => {
147-
eprintln!("Error executing uniffi-bindgen-go: {}", e);
147+
eprintln!("Error executing uniffi-bindgen-go: {e}");
148148
process::exit(1);
149149
}
150150
}

crates/uniffi/src/bin/uniffi-bindgen-react-native.rs

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

6161
// Default paths
62-
let default_lib = format!("target/release/libdojo_uniffi.{}", lib_ext);
62+
let default_lib = format!("target/release/libdojo_uniffi.{lib_ext}");
6363
let default_out = "bindings/react-native";
6464

6565
// Parse arguments
@@ -72,7 +72,7 @@ fn main() {
7272
Utf8PathBuf::from(positional_args.get(1).map(|s| s.as_str()).unwrap_or(default_out));
7373

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

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

8888
println!("Generating React Native bindings...");
89-
println!("Library: {}", library_path);
90-
println!("Output: {}", out_dir);
89+
println!("Library: {library_path}");
90+
println!("Output: {out_dir}");
9191

9292
// Build command for uniffi-bindgen-react-native
9393
let mut cmd = process::Command::new("uniffi-bindgen-react-native");
@@ -115,7 +115,7 @@ fn main() {
115115
}
116116
}
117117
Err(e) => {
118-
eprintln!("Error executing uniffi-bindgen-react-native: {}", e);
118+
eprintln!("Error executing uniffi-bindgen-react-native: {e}");
119119
process::exit(1);
120120
}
121121
}

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

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ fn main() {
5252
};
5353

5454
// Default paths (must match the library output name)
55-
let default_lib = format!("target/release/libdojo_uniffi.{}", lib_ext);
55+
let default_lib = format!("target/release/libdojo_uniffi.{lib_ext}");
5656
let default_out = "bindings/swift";
5757

5858
// Parse arguments
@@ -65,7 +65,7 @@ fn main() {
6565
Utf8PathBuf::from(positional_args.get(1).map(|s| s.as_str()).unwrap_or(default_out));
6666

6767
if !library_path.exists() {
68-
eprintln!("Error: Library file not found: {}", library_path);
68+
eprintln!("Error: Library file not found: {library_path}");
6969
eprintln!("Build the library first with: cargo build --release -p dojo-uniffi");
7070
eprintln!();
7171
eprintln!("Hint: Run with --help to see usage information");
@@ -74,7 +74,7 @@ fn main() {
7474

7575
// Create output directory if it doesn't exist
7676
if let Err(e) = std::fs::create_dir_all(&out_dir) {
77-
eprintln!("Error: Failed to create output directory {}: {}", out_dir, e);
77+
eprintln!("Error: Failed to create output directory {out_dir}: {e}");
7878
process::exit(1);
7979
}
8080

@@ -85,14 +85,12 @@ fn main() {
8585
let has_xcframework = args.contains(&"--xcframework".to_string());
8686

8787
// Default to generating Swift sources and headers if no specific flags are provided
88-
let generate_swift_sources =
89-
has_swift_sources || (!has_headers && !has_modulemap) || (has_headers);
90-
let generate_headers =
91-
has_headers || (!has_swift_sources && !has_modulemap) || has_swift_sources;
88+
let generate_swift_sources = has_swift_sources || has_headers || !has_modulemap;
89+
let generate_headers = has_headers || has_swift_sources || !has_modulemap;
9290

9391
println!("Generating Swift bindings...");
94-
println!("Library: {}", library_path);
95-
println!("Output: {}", out_dir);
92+
println!("Library: {library_path}");
93+
println!("Output: {out_dir}");
9694

9795
let options = SwiftBindingsOptions {
9896
generate_swift_sources,
@@ -112,7 +110,7 @@ fn main() {
112110
println!("✓ Swift bindings generated successfully!");
113111
}
114112
Err(e) => {
115-
eprintln!("Error generating bindings: {}", e);
113+
eprintln!("Error generating bindings: {e}");
116114
process::exit(1);
117115
}
118116
}

0 commit comments

Comments
 (0)