feat: Optimize KPM file processing logic, use is_some_and method to simplify extension checking, and enhance readability and stability of event processing.

This commit is contained in:
ShirkNeko
2025-04-07 22:28:22 +08:00
parent 138dec35c7
commit b850336872
2 changed files with 37 additions and 34 deletions

View File

@@ -103,7 +103,7 @@ pub fn on_post_data_fs() -> Result<()> {
for entry in std::fs::read_dir(kpm::KPM_DIR)? {
let path = entry?.path();
if path.extension().map_or(false, |ext| ext == "kpm") {
if path.extension().is_some_and(|ext| ext == "kpm") {
let _ = kpm::load_kpm(&path);
}
}