(&self, pos: Position<NodeId>)
| 220 | } |
| 221 | |
| 222 | fn find_block_end(&self, pos: Position<NodeId>) -> PristineResult<GraphNode<NodeId>> { |
| 223 | if pos.change.is_root() { |
| 224 | return Ok(GraphNode::ROOT); |
| 225 | } |
| 226 | |
| 227 | let change_id = pos.change.get(); |
| 228 | let target_pos = pos.pos.get(); |
| 229 | self.ensure_loaded(change_id)?; |
| 230 | |
| 231 | if let Some((s, e)) = self.index.borrow().find_block_end(change_id, target_pos) { |
| 232 | return Ok(GraphNode { |
| 233 | change: NodeId::new(change_id), |
| 234 | start: ChangePosition::new(s), |
| 235 | end: ChangePosition::new(e), |
| 236 | }); |
| 237 | } |
| 238 | |
| 239 | Err(PristineError::BlockNotFound { |
| 240 | change: change_id, |
| 241 | pos: target_pos, |
| 242 | }) |
| 243 | } |
| 244 | |
| 245 | fn has_vertex(&self, node: GraphNode<NodeId>) -> PristineResult<bool> { |
| 246 | let key = encode_vertex(node.change.get(), node.start.get(), node.end.get()); |
no test coverage detected