bet/child.rs
1use crate::*;
2
3/// One of the children of a node
4///
5/// You probably don't need to use this struct unless
6/// you want to inspect the binary expression tree.
7#[derive(Debug, Clone, Copy, PartialEq)]
8pub enum Child {
9 None,
10 Node(NodeId),
11 Atom(AtomId),
12}
13impl Child {
14 pub fn is_none(self) -> bool {
15 matches!(self, Self::None)
16 }
17 pub fn is_some(self) -> bool {
18 !self.is_none()
19 }
20}