mirror of
https://gitlab.com/gabmus/envision.git
synced 2025-04-22 12:34:49 +00:00
fix: default with schema for monado config v0
This commit is contained in:
parent
9339ca15e4
commit
57a8cbe809
1 changed files with 10 additions and 1 deletions
|
@ -155,7 +155,7 @@ impl Default for TrackerRole {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Default)]
|
||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
|
||||
pub struct MonadoConfigV0 {
|
||||
#[serde(skip_serializing_if = "Option::is_none", rename = "$schema")]
|
||||
_schema: Option<String>,
|
||||
|
@ -163,6 +163,15 @@ pub struct MonadoConfigV0 {
|
|||
pub tracker_roles: Vec<TrackerRole>,
|
||||
}
|
||||
|
||||
impl Default for MonadoConfigV0 {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
_schema: Some("https://monado.pages.freedesktop.org/monado/config_v0.schema.json".to_string()),
|
||||
tracker_roles: vec![],
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl MonadoConfigV0 {
|
||||
pub fn has_tracker_serial(&self, serial: &str) -> bool {
|
||||
self.tracker_roles.iter().any(|t| t.device_serial == serial)
|
||||
|
|
Loading…
Add table
Reference in a new issue