From 5770b7007c35f283adb462ca53517f02faab95b1 Mon Sep 17 00:00:00 2001 From: XiuChengWu <732857315@qq.com> Date: Tue, 31 Mar 2026 23:45:00 +0800 Subject: [PATCH] chore: remove unused Config type alias, add deny_unknown_fields to remaining config structs --- src/core/config.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/core/config.rs b/src/core/config.rs index ceb4a5d..8cc152f 100644 --- a/src/core/config.rs +++ b/src/core/config.rs @@ -4,8 +4,6 @@ use std::collections::{HashMap, HashSet}; use std::fs; use std::path::{Path, PathBuf}; -pub type Config = AppConfig; - #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(deny_unknown_fields)] pub struct AppConfig { @@ -72,6 +70,7 @@ pub struct PerspectiveCorrectionConfig { } #[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(deny_unknown_fields)] pub struct ChromaKeyConfig { #[serde(default)] pub enabled: bool, @@ -106,6 +105,7 @@ fn default_hsv_max() -> [i32; 3] { } #[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(deny_unknown_fields)] pub struct BrightnessAdjustConfig { #[serde(default)] pub enabled: bool, @@ -272,8 +272,9 @@ pub struct RemoteControlConfig { pub port: u16, } -/// BLE 配网配置(新增) +/// BLE 配网配置 #[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(deny_unknown_fields)] pub struct BleConfig { #[serde(default = "default_ble_enabled")] pub enabled: bool,