summaryrefslogtreecommitdiff
path: root/gen/src/gen_mod_files.rs
diff options
context:
space:
mode:
author魏曹先生 <1992414357@qq.com>2026-03-20 22:21:56 +0800
committer魏曹先生 <1992414357@qq.com>2026-03-20 22:21:56 +0800
commitab6be7968b25afb57fc428695693484ad8576718 (patch)
treee4af27964f195a18a678844dbe71c0aaa182b5dc /gen/src/gen_mod_files.rs
parent6b22f7b7694fce530f84ba94c65c057450cca626 (diff)
Refactor code to use modern Rust idioms and fix clippy lints
Diffstat (limited to 'gen/src/gen_mod_files.rs')
-rw-r--r--gen/src/gen_mod_files.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/gen/src/gen_mod_files.rs b/gen/src/gen_mod_files.rs
index d0b0800..1d20f43 100644
--- a/gen/src/gen_mod_files.rs
+++ b/gen/src/gen_mod_files.rs
@@ -1,9 +1,9 @@
-use std::path::PathBuf;
+use std::path::Path;
use crate::constants::REGISTRY_TOML;
/// Generate collect files from directory structure
-pub async fn generate_collect_files(repo_root: &PathBuf) {
+pub async fn generate_collect_files(repo_root: &Path) {
// Read and parse the TOML configuration
let config_path = repo_root.join(REGISTRY_TOML);
let config_content = tokio::fs::read_to_string(&config_path).await.unwrap();
@@ -38,7 +38,7 @@ pub async fn generate_collect_files(repo_root: &PathBuf) {
// Get the directory path for this collect type
// e.g., for "src/renderers.rs", we want "src/renderers/"
- let output_parent = output_path.parent().unwrap_or_else(|| repo_root.as_path());
+ let output_parent = output_path.parent().unwrap_or(repo_root);
let dir_path = output_parent.join(&dir_name);
// Collect all .rs files in the directory (excluding the output file itself)