Do subvalidation on the config
This commit is contained in:
2 files changed
+1
-6
No files matched your search
@@ -12,6 +12,7 @@ lazy_static! {
|
||||
|
||||
#[derive(Debug, Deserialize, Validate, Clone)]
|
||||
pub struct Config {
|
||||
#[validate]
|
||||
pub cameras: Vec<CameraConfig>,
|
||||
|
||||
#[serde(rename = "bind", default = "default_bind_addr")]
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in new issue
Block a user