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