pub trait Depth {
fn is_zero(&self) -> bool;
fn decrease(&mut self);
}
impl Depth for Option<usize> {
fn is_zero(&self) -> bool {
self.map(|depth| depth == 0).unwrap_or_default()
}
fn decrease(&mut self) {
*self = self.map(|depth| if depth > 1 { depth - 1 } else { 0 });
}
}