Skip to content

Commit b3c227f

Browse files
Y-RyuZUclaude
andcommitted
fix: apply cargo fmt for remaining formatting issues
- Fixed multi-line format strings to single line where appropriate - Consistent formatting across all Rust files - Applied automatically using cargo fmt Co-Authored-By: Claude <[email protected]>
1 parent 9063a9a commit b3c227f

File tree

3 files changed

+8
-24
lines changed

3 files changed

+8
-24
lines changed

src-tauri/src/backup.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -317,9 +317,7 @@ pub fn restore_backup(
317317
}
318318

319319
logger.info(
320-
&format!(
321-
"Backup restoration completed: {restored_count} files restored"
322-
),
320+
&format!("Backup restoration completed: {restored_count} files restored"),
323321
Some("BACKUP"),
324322
);
325323
Ok(())
@@ -388,9 +386,7 @@ pub fn prune_old_backups(
388386
}
389387

390388
logger.info(
391-
&format!(
392-
"Backup pruning completed: {deleted_count} backups removed"
393-
),
389+
&format!("Backup pruning completed: {deleted_count} backups removed"),
394390
Some("BACKUP"),
395391
);
396392
Ok(deleted_count)

src-tauri/src/filesystem.rs

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -499,17 +499,13 @@ pub async fn create_resource_pack(
499499
language: &str,
500500
dir: &str,
501501
) -> std::result::Result<String, String> {
502-
info!(
503-
"Creating resource pack {name} for {language} in {dir}"
504-
);
502+
info!("Creating resource pack {name} for {language} in {dir}");
505503

506504
let dir_path = Path::new(dir);
507505
if !dir_path.exists() || !dir_path.is_dir() {
508506
// Try to create the parent directory if it does not exist
509507
if let Err(e) = std::fs::create_dir_all(dir_path) {
510-
return Err(format!(
511-
"Failed to create parent directory: {dir} ({e})"
512-
));
508+
return Err(format!("Failed to create parent directory: {dir} ({e})"));
513509
}
514510
}
515511

@@ -566,9 +562,7 @@ pub async fn write_lang_file(
566562
dir: &str,
567563
format: Option<&str>,
568564
) -> std::result::Result<bool, String> {
569-
info!(
570-
"Writing lang file for {mod_id} in {language} to {dir} with format {format:?}"
571-
);
565+
info!("Writing lang file for {mod_id} in {language} to {dir} with format {format:?}");
572566

573567
let dir_path = Path::new(dir);
574568
if !dir_path.exists() || !dir_path.is_dir() {

src-tauri/src/minecraft/mod.rs

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -337,9 +337,7 @@ pub fn write_patchouli_book(
337337
}
338338

339339
// Add the new language file
340-
let file_path = format!(
341-
"assets/{mod_id}/patchouli_books/{book_id}/{language}.json"
342-
);
340+
let file_path = format!("assets/{mod_id}/patchouli_books/{book_id}/{language}.json");
343341

344342
if let Err(e) = temp_archive.start_file(file_path, zip::write::FileOptions::default()) {
345343
return Err(format!("Failed to start language file in archive: {e}"));
@@ -549,9 +547,7 @@ fn extract_lang_files_from_archive(
549547
match serde_json::from_str(&clean_content_str) {
550548
Ok(content) => content,
551549
Err(e) => {
552-
error!(
553-
"Failed to parse lang file '{name}': {e}. Skipping this file."
554-
);
550+
error!("Failed to parse lang file '{name}': {e}. Skipping this file.");
555551
// Skip this file instead of failing the entire mod
556552
continue;
557553
}
@@ -647,9 +643,7 @@ fn extract_lang_files_from_archive_with_format(
647643
match serde_json::from_str(&clean_content_str) {
648644
Ok(content) => content,
649645
Err(e) => {
650-
error!(
651-
"Failed to parse lang file '{name}': {e}. Skipping this file."
652-
);
646+
error!("Failed to parse lang file '{name}': {e}. Skipping this file.");
653647
// Skip this file instead of failing the entire mod
654648
continue;
655649
}

0 commit comments

Comments
 (0)