diff options
| author | 魏曹先生 <1992414357@qq.com> | 2025-09-14 12:42:15 +0800 |
|---|---|---|
| committer | 魏曹先生 <1992414357@qq.com> | 2025-09-14 12:42:15 +0800 |
| commit | b8844ab55a6d622370be8ce41387ff9d9897302e (patch) | |
| tree | 049d6093491dba003994661dd51eba7db36c6219 /crates/utils/cfg_file/src/config.rs | |
| parent | 5b26558c895e58a31a0ab7630b1c05c525091f53 (diff) | |
Fixed by Clippy
Diffstat (limited to 'crates/utils/cfg_file/src/config.rs')
| -rw-r--r-- | crates/utils/cfg_file/src/config.rs | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/crates/utils/cfg_file/src/config.rs b/crates/utils/cfg_file/src/config.rs index dd542cf..2bc104d 100644 --- a/crates/utils/cfg_file/src/config.rs +++ b/crates/utils/cfg_file/src/config.rs @@ -58,7 +58,7 @@ pub trait ConfigFile: Serialize + for<'a> Deserialize<'a> + Default { { let path = path.as_ref(); let file_path = match current_dir() { - Ok(cwd) => cwd.join(&path), + Ok(cwd) => cwd.join(path), Err(e) => { eprintln!("Failed to get current directory: {}", e); return Self::DataType::default(); @@ -135,14 +135,13 @@ pub trait ConfigFile: Serialize + for<'a> Deserialize<'a> + Default { { let path = path.as_ref(); - if let Some(parent) = path.parent() { - if ! parent.exists() { + if let Some(parent) = path.parent() + && ! parent.exists() { let _ = tokio::fs::create_dir_all(parent).await; } - } let file_path = match current_dir() { - Ok(cwd) => cwd.join(&path), + Ok(cwd) => cwd.join(path), Err(e) => { eprintln!("Failed to get current directory: {}", e); return; |
