Repository navigation
directededge: return the edge's cells as two values - #186
Merged
Merged
Conversation
DirectedEdge#Cells returned a []Cell that always held exactly two cells,
the origin and the destination. It now returns them as two values, the
same shape as DirectedEdge#Vertexes: the signature states the count and
the order, and the call no longer allocates a slice.
This breaks callers. Code that read the slice, such as
cells, err := edge.Cells()
origin, destination := cells[0], cells[1]
becomes
origin, destination, err := edge.Cells()
Validation is unchanged. A non-edge index still fails with
ErrDirectedEdgeInvalid from Origin, and an origin that cannot step to its
neighbor still fails from Destination. Both values are zero on error.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
justinhwang
force-pushed
the
directededge/cells-two-values
branch
from
November 19, 2026 17:15
8c3d541 to
e0351a4
Compare
Coverage Report for CI Build 44575254393Warning Build has drifted: This PR's base is out of sync with its target branch, so coverage data may include unrelated changes. Coverage remained the same at 100.0%Details
Uncovered ChangesNo uncovered changes found. Coverage RegressionsNo coverage regressions found. Coverage Stats
💛 - Coveralls |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Breaking change.
DirectedEdge#Cellsnow returns(Cell, Cell, error), the origin and the destination, instead of a[]Cell.The slice always held exactly two cells. Two values match
DirectedEdge#Vertexes(#184): the signature states the count and the order, and the call no longer allocates.Migration:
Validation is unchanged. A non-edge index still fails with
ErrDirectedEdgeInvalidfromOrigin, and an origin that cannot step to its neighbor still fails fromDestination. Both values are zero on error.The changelog's Unreleased section gains a Breaking Changes heading with this entry.
Testing
The existing directed-edge tests now use the two values: the corpus round trip, the cell-mode rejection and the corrupt-origin failure.
Cellsstays at 100% coverage, and lint and the full test suite pass.