(&self, pos: Position<NodeId>)
| 248 | } |
| 249 | |
| 250 | fn find_block_end(&self, pos: Position<NodeId>) -> PristineResult<GraphNode<NodeId>> { |
| 251 | if pos.change.is_root() { |
| 252 | return Ok(GraphNode::ROOT); |
| 253 | } |
| 254 | |
| 255 | let change_id = pos.change.get(); |
| 256 | let target_pos = pos.pos.get(); |
| 257 | self.ensure_loaded(change_id)?; |
| 258 | |
| 259 | if let Some((s, e)) = self.index.borrow().find_block_end(change_id, target_pos) { |
| 260 | return Ok(GraphNode { |
| 261 | change: NodeId::new(change_id), |
| 262 | start: ChangePosition::new(s), |
| 263 | end: ChangePosition::new(e), |
| 264 | }); |
| 265 | } |
| 266 | |
| 267 | Err(PristineError::BlockNotFound { |
| 268 | change: change_id, |
| 269 | pos: target_pos, |
| 270 | }) |
| 271 | } |
| 272 | |
| 273 | fn has_vertex(&self, node: GraphNode<NodeId>) -> PristineResult<bool> { |
| 274 | let key = encode_vertex(node.change.get(), node.start.get(), node.end.get()); |
no test coverage detected