This commit is contained in:
Alex Ozdemir
2023-12-13 08:17:41 -08:00
committed by GitHub
parent 697c240148
commit 6133414b44
2 changed files with 9 additions and 9 deletions

View File

@@ -664,6 +664,14 @@ impl NaryFlat<Integer> for IntNaryOp {
}
}
fn safe_nary(op: Op, mut children: Vec<Term>) -> Term {
match children.len() {
0 => panic!("Empty {}", op),
1 => children.pop().unwrap(),
_ => term(op, children),
}
}
#[cfg(test)]
mod test {
use super::*;
@@ -767,11 +775,3 @@ mod test {
assert_eq!(fold(&before, &[]), ex_after);
}
}
fn safe_nary(op: Op, mut children: Vec<Term>) -> Term {
match children.len() {
0 => panic!("Empty {}", op),
1 => children.pop().unwrap(),
_ => term(op, children),
}
}

View File

@@ -30,7 +30,7 @@ pub fn check_ram(c: &mut Computation, ram: Ram) {
BoundaryConditions::Persistent(..) => panic!(),
};
let id = ram.id;
let ns = Namespace::new().subspace(&format!("ram{id}"));
let ns = Namespace::new().subspace(format!("ram{id}"));
let f_s = Sort::Field(f.clone());
let v_s = ram.val_sort.clone();