Clarify two more comments (#2384)

* Make language clearer

* Two more comments
This commit is contained in:
Dominik Maier 2024-07-12 13:07:19 +02:00 committed by GitHub
parent d4101a671c
commit 24aa640df7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 2 deletions

View File

@ -280,7 +280,8 @@ impl Tree {
for i in 0..self.size() { for i in 0..self.size() {
let node_id = NodeId::from(i); let node_id = NodeId::from(i);
let nonterm = self.get_rule(node_id, ctx).nonterm(); let nonterm = self.get_rule(node_id, ctx).nonterm();
//sanity check
// This should never panic!
let (nterm_id, node) = stack.pop().expect("Not a valid tree for unparsing!"); let (nterm_id, node) = stack.pop().expect("Not a valid tree for unparsing!");
if nterm_id == nonterm { if nterm_id == nonterm {
self.paren[i] = node; self.paren[i] = node;

View File

@ -822,7 +822,7 @@ mod tests {
#[test] #[test]
fn test_map_is_novel() { fn test_map_is_novel() {
// sanity check // This should always hold
assert!(AllIsNovel::is_novel(0_u8, 0)); assert!(AllIsNovel::is_novel(0_u8, 0));
assert!(!NextPow2IsNovel::is_novel(0_u8, 0)); assert!(!NextPow2IsNovel::is_novel(0_u8, 0));