Skip to content

Commit

Permalink
Merge pull request #32 from tinythings/isbm-cleanup
Browse files Browse the repository at this point in the history
Remove stale dead code
  • Loading branch information
isbm authored Oct 28, 2024
2 parents e4e5ef4 + bf52f0b commit ea63bae
Showing 1 changed file with 0 additions and 39 deletions.
39 changes: 0 additions & 39 deletions libsysinspect/src/mdescr/mspecdef.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
use crate::SysinspectError;
use serde::{Deserialize, Serialize};
use serde_yaml::Value;
use std::{collections::HashMap, path::PathBuf};
Expand Down Expand Up @@ -45,44 +44,6 @@ impl ModelSpec {
None
}

#[allow(clippy::only_used_in_recursion)]
fn find(&self, v: Value) -> Result<Value, SysinspectError> {
match v {
/*
Value::Sequence(v) => {
for e in v.iter() {
self.find(e);
}
}
*/
Value::Mapping(v) => {
if let Some((k, e)) = v.into_iter().next() {
return self.find(e);
}
}
Value::Bool(_) | Value::Number(_) | Value::String(_) => {
return Ok(v);
}
_ => {}
}

Err(SysinspectError::ModelDSLError("Object not found".to_string()))
}

/// Traverse the namespace by "foo:bar:person.name" syntax.
/// "foo:bar" is a namespace, "person" is an ID of the object and "name" is a property.
/// This yields to the following YAML:
///
/// ```yaml
/// foo:
/// bar:
/// id: person
/// name: Jeff
/// ```
pub fn traverse(&self, path: String) {
if path.contains(".") && path.contains(":") {}
}

/// Returns Path to the inherited model
pub fn inherits(&self) -> Option<PathBuf> {
if let Some(p) = &self.inherits {
Expand Down

0 comments on commit ea63bae

Please sign in to comment.