🐛 Fix Clippy lint warnings and add Rust formatting
- Update format strings to use inline arguments in util.rs - Add cargo fmt to npm run format script for unified code formatting 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -41,7 +41,7 @@
|
|||||||
"cli": "rollup -c rollup.config.js --watch",
|
"cli": "rollup -c rollup.config.js --watch",
|
||||||
"cli:dev": "cross-env NODE_ENV=development rollup -c rollup.config.js -w",
|
"cli:dev": "cross-env NODE_ENV=development rollup -c rollup.config.js -w",
|
||||||
"cli:build": "cross-env NODE_ENV=production rollup -c rollup.config.js",
|
"cli:build": "cross-env NODE_ENV=production rollup -c rollup.config.js",
|
||||||
"format": "npx prettier --write . --ignore-unknown",
|
"format": "npx prettier --write . --ignore-unknown && cd src-tauri && cargo fmt",
|
||||||
"prepublishOnly": "npm run cli:build"
|
"prepublishOnly": "npm run cli:build"
|
||||||
},
|
},
|
||||||
"type": "module",
|
"type": "module",
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ pub fn get_data_dir(app: &AppHandle, package_name: String) -> PathBuf {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn show_toast(window: &WebviewWindow, message: &str) {
|
pub fn show_toast(window: &WebviewWindow, message: &str) {
|
||||||
let script = format!(r#"pakeToast("{}");"#, message);
|
let script = format!(r#"pakeToast("{message}");"#);
|
||||||
window.eval(&script).unwrap();
|
window.eval(&script).unwrap();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -98,15 +98,15 @@ pub fn check_file_or_append(file_path: &str) -> String {
|
|||||||
Some(index) if file_stem[index + 1..].parse::<u32>().is_ok() => {
|
Some(index) if file_stem[index + 1..].parse::<u32>().is_ok() => {
|
||||||
let base_name = &file_stem[..index];
|
let base_name = &file_stem[..index];
|
||||||
counter = file_stem[index + 1..].parse::<u32>().unwrap() + 1;
|
counter = file_stem[index + 1..].parse::<u32>().unwrap() + 1;
|
||||||
format!("{}-{}", base_name, counter)
|
format!("{base_name}-{counter}")
|
||||||
}
|
}
|
||||||
_ => {
|
_ => {
|
||||||
counter += 1;
|
counter += 1;
|
||||||
format!("{}-{}", file_stem, counter)
|
format!("{file_stem}-{counter}")
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
new_path = parent_dir.join(format!("{}.{}", new_file_stem, extension));
|
new_path = parent_dir.join(format!("{new_file_stem}.{extension}"));
|
||||||
}
|
}
|
||||||
|
|
||||||
new_path.to_string_lossy().into_owned()
|
new_path.to_string_lossy().into_owned()
|
||||||
|
|||||||
Reference in New Issue
Block a user