fix: make pull_trunk pull from the trunk, rather than the root

This commit is contained in:
Nat 2024-12-11 10:06:50 -08:00
parent ca66fbc895
commit cb693c16e7
1 changed files with 3 additions and 3 deletions

View File

@ -136,14 +136,14 @@ impl Tree {
pub fn pull_root(&mut self) -> u16 {
match self.root.pop() {
Some(v) => v,
None => panic!("Cannot pop from empty root stack in {}", self.rule_id)
None => panic!("Cannot pop from empty root stack in rule #{}", self.rule_id)
}
}
pub fn pull_trunk(&mut self) -> u16 {
match self.root.pop() {
match self.trunk.pop() {
Some(v) => v,
None => panic!("Cannot pop from empty trunk stack in {}", self.rule_id)
None => panic!("Cannot pop from empty trunk stack in rule #{}", self.rule_id)
}
}