(self, other: AbstractValue)
| 81 | |
| 82 | impl AbstractValue { |
| 83 | fn join(self, other: AbstractValue) -> AbstractValue { |
| 84 | match (self, other) { |
| 85 | // Joining with `None` has no effect |
| 86 | (AbstractValue::None, p2) => p2, |
| 87 | (p1, AbstractValue::None) => p1, |
| 88 | // Joining with `Many` produces `Many` |
| 89 | (AbstractValue::Many, _p2) => AbstractValue::Many, |
| 90 | (_p1, AbstractValue::Many) => AbstractValue::Many, |
| 91 | // The only interesting case |
| 92 | (AbstractValue::One(v1), AbstractValue::One(v2)) => { |
| 93 | if v1 == v2 { |
| 94 | AbstractValue::One(v1) |
| 95 | } else { |
| 96 | AbstractValue::Many |
| 97 | } |
| 98 | } |
| 99 | } |
| 100 | } |
| 101 | |
| 102 | fn is_one(self) -> bool { |
| 103 | matches!(self, AbstractValue::One(_)) |
no outgoing calls
no test coverage detected