(
txn: &CachedWriteGraphTxn<'_, '_>,
source: GraphNode<NodeId>,
target: GraphNode<NodeId>,
previous: crate::types::EdgeFlags,
introduced_by: NodeId,
)
| 359 | } |
| 360 | |
| 361 | fn source_has_exact_edge( |
| 362 | txn: &CachedWriteGraphTxn<'_, '_>, |
| 363 | source: GraphNode<NodeId>, |
| 364 | target: GraphNode<NodeId>, |
| 365 | previous: crate::types::EdgeFlags, |
| 366 | introduced_by: NodeId, |
| 367 | ) -> Result<bool, LocalApplyError> { |
| 368 | let adjacent = txn |
| 369 | .iter_adjacent( |
| 370 | source, |
| 371 | crate::types::EdgeFlags::empty(), |
| 372 | crate::types::EdgeFlags::all(), |
| 373 | ) |
| 374 | .map_err(|error| LocalApplyError::Internal { |
| 375 | message: format!("failed to validate prior edge from {}: {}", source, error), |
| 376 | })?; |
| 377 | for edge in adjacent { |
| 378 | let edge = edge.map_err(|error| LocalApplyError::Internal { |
| 379 | message: format!("failed to read prior edge from {}: {}", source, error), |
| 380 | })?; |
| 381 | if edge.flag() == previous |
| 382 | && edge.dest() == target.start_pos() |
| 383 | && edge.introduced_by() == introduced_by |
| 384 | { |
| 385 | return Ok(true); |
| 386 | } |
| 387 | } |
| 388 | Ok(false) |
| 389 | } |
| 390 | |
| 391 | // Span Finding |
| 392 |
no test coverage detected