(&self, other: &Self)
| 67 | } |
| 68 | |
| 69 | pub fn meet(&self, other: &Self) -> Self { |
| 70 | let all_paths: HashSet<Rc<Path>> = self |
| 71 | .value_map |
| 72 | .keys() |
| 73 | .chain(other.value_map.keys()) |
| 74 | .cloned() |
| 75 | .collect(); |
| 76 | let mut value_map = HashMap::new(); |
| 77 | for path in all_paths { |
| 78 | match (self.get(&path), other.get(&path)) { |
| 79 | (Some(left), Some(right)) if left == right => { |
| 80 | value_map.insert(path, left); |
| 81 | } |
| 82 | (Some(left), None) => { |
| 83 | value_map.insert(path, left); |
| 84 | } |
| 85 | (None, Some(right)) => { |
| 86 | value_map.insert(path, right); |
| 87 | } |
| 88 | _ => {} |
| 89 | } |
| 90 | } |
| 91 | Self { value_map } |
| 92 | } |
| 93 | |
| 94 | pub fn widening_with(&self, other: &Self) -> Self { |
| 95 | self.join(other) |
no test coverage detected