Do subvalidation on the config

This commit is contained in:
QuantumEntangledAndy committed 2020-07-02 10:02:13 +07:00
1 parent 698fc0841f
commit 55555333ff
2 files changed
+1 -6

No files matched your search

+1
View File
@@ -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")]
-6
View File
@@ -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