chore: remove unused Config type alias, add deny_unknown_fields to remaining config structs
This commit is contained in:
@@ -4,8 +4,6 @@ use std::collections::{HashMap, HashSet};
|
|||||||
use std::fs;
|
use std::fs;
|
||||||
use std::path::{Path, PathBuf};
|
use std::path::{Path, PathBuf};
|
||||||
|
|
||||||
pub type Config = AppConfig;
|
|
||||||
|
|
||||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||||
#[serde(deny_unknown_fields)]
|
#[serde(deny_unknown_fields)]
|
||||||
pub struct AppConfig {
|
pub struct AppConfig {
|
||||||
@@ -72,6 +70,7 @@ pub struct PerspectiveCorrectionConfig {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||||
|
#[serde(deny_unknown_fields)]
|
||||||
pub struct ChromaKeyConfig {
|
pub struct ChromaKeyConfig {
|
||||||
#[serde(default)]
|
#[serde(default)]
|
||||||
pub enabled: bool,
|
pub enabled: bool,
|
||||||
@@ -106,6 +105,7 @@ fn default_hsv_max() -> [i32; 3] {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||||
|
#[serde(deny_unknown_fields)]
|
||||||
pub struct BrightnessAdjustConfig {
|
pub struct BrightnessAdjustConfig {
|
||||||
#[serde(default)]
|
#[serde(default)]
|
||||||
pub enabled: bool,
|
pub enabled: bool,
|
||||||
@@ -272,8 +272,9 @@ pub struct RemoteControlConfig {
|
|||||||
pub port: u16,
|
pub port: u16,
|
||||||
}
|
}
|
||||||
|
|
||||||
/// BLE 配网配置(新增)
|
/// BLE 配网配置
|
||||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||||
|
#[serde(deny_unknown_fields)]
|
||||||
pub struct BleConfig {
|
pub struct BleConfig {
|
||||||
#[serde(default = "default_ble_enabled")]
|
#[serde(default = "default_ble_enabled")]
|
||||||
pub enabled: bool,
|
pub enabled: bool,
|
||||||
|
|||||||
Reference in New Issue
Block a user