diff --git a/src/config.rs b/src/config.rs index 230449f..576ea99 100644 --- a/src/config.rs +++ b/src/config.rs @@ -12,6 +12,7 @@ lazy_static! { #[derive(Debug, Deserialize, Validate, Clone)] pub struct Config { + #[validate] pub cameras: Vec, #[serde(rename = "bind", default = "default_bind_addr")] diff --git a/src/main.rs b/src/main.rs index 9f74799..ec7f9f1 100644 --- a/src/main.rs +++ b/src/main.rs @@ -47,12 +47,6 @@ fn main() -> Result<(), Error> { Ok(_) => (), Err(e) => return Err(Error::ValidationError(e)), }; - for camera in &config.cameras { - match camera.validate() { - Ok(_) => (), - Err(e) => return Err(Error::ValidationError(e)), - }; - } // Setup auto sub streams, we do this by looping the cameras // If the stream type is both we clone the config