#[derive(Debug, Clone, PartialEq, Eq, Default)]
pub struct Manifest {
pub max_depth: Option<usize>,
pub ignore_text: bool,
}
impl Manifest {
pub fn has_max_depth(&self) -> bool {
self.max_depth.is_some() && self.max_depth.unwrap() > 0
}
}
#[cfg_attr(tarpaulin, skip)]
#[cfg(test)]
mod tests {
use super::Manifest;
#[test]
fn has_max_depth() {
let mut manifest = Manifest::default();
manifest.max_depth = Some(1);
assert!(manifest.has_max_depth());
manifest.max_depth = Some(3);
assert!(manifest.has_max_depth());
manifest.max_depth = None;
assert!(!manifest.has_max_depth());
}
}