(&mut self, a: Val, b: Val, op: impl Fn(i128, i128) -> i128)
| 128 | } |
| 129 | |
| 130 | pub fn bitwise_op(&mut self, a: Val, b: Val, op: impl Fn(i128, i128) -> i128) -> Result<Val, VmErr> { |
| 131 | let ai = as_i128(a, &self.heap).ok_or(cold_type("bitwise op requires integer operands"))?; |
| 132 | let bi = as_i128(b, &self.heap).ok_or(cold_type("bitwise op requires integer operands"))?; |
| 133 | let r = op(ai, bi); |
| 134 | self.int_to_val(Some(r)) |
| 135 | } |
| 136 | |
| 137 | /* Clone the element set out of a `set` or `frozenset`; None for any other type. */ |
| 138 | pub(crate) fn clone_set_items(&self, v: Val) -> Option<ValSet> { |
no test coverage detected