From 4d98cd98debba7de222985ef9351cf0b6f60ff9b Mon Sep 17 00:00:00 2001 From: 魏曹先生 <1992414357@qq.com> Date: Sat, 18 Oct 2025 18:46:05 +0800 Subject: Update `config.rs` - If config file not exist, now return Error --- crates/utils/cfg_file/src/config.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'crates/utils') diff --git a/crates/utils/cfg_file/src/config.rs b/crates/utils/cfg_file/src/config.rs index 0211e75..a1eb301 100644 --- a/crates/utils/cfg_file/src/config.rs +++ b/crates/utils/cfg_file/src/config.rs @@ -57,7 +57,10 @@ pub trait ConfigFile: Serialize + for<'a> Deserialize<'a> + Default { // Check if file exists if fs::metadata(&file_path).await.is_err() { - return Ok(Self::DataType::default()); + return Err(std::io::Error::new( + std::io::ErrorKind::NotFound, + "Config file not found", + )); } // Open file -- cgit