#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)]
#[non_exhaustive]
pub struct Manifest {
pub max_depth: Option<usize>,
pub ignore_text: bool,
pub gnu_ordering: 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]
#[allow(clippy::field_reassign_with_default)]
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());
}
}