refactor(repair)!: box Delaunay repair flip errors#407
Conversation
- Box `DelaunayRepairError::Flip` sources while preserving typed `FlipError`
inspection through `From<FlipError>` and `Error::source`.
- Update repair and construction mappings for the named boxed variant.
- Cover clone and source behavior for wrapped linear-algebra errors.
BREAKING CHANGE: `DelaunayRepairError::Flip` is now a named variant with
`source: Box<FlipError>` instead of the tuple variant `Flip(FlipError)`.
Callers that pattern-match this variant must use `Flip { source }` or
construct it through `DelaunayRepairError::from`.
Closes #384
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughDelaunayRepairError::Flip is refactored from tuple-style Flip(FlipError) to struct-style Flip { source: Box }. All conversions, match sites, internal helpers, and tests are updated to construct via From and to inspect the inner FlipError via source.as_ref() or source() downcasts. ChangesError Enum Boxing Refactor
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Possibly related issues
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 0 |
🟢 Coverage 93.42% diff coverage · +0.01% coverage variation
Metric Results Coverage variation ✅ +0.01% coverage variation (-1.00%) Diff coverage ✅ 93.42% diff coverage Coverage variation details
Coverable lines Covered lines Coverage Common ancestor commit (71336b5) 62391 56471 90.51% Head commit (739e422) 62454 (+63) 56536 (+65) 90.52% (+0.01%) Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch:
<coverage of head commit> - <coverage of common ancestor commit>Diff coverage details
Coverable lines Covered lines Diff coverage Pull request (#407) 76 71 93.42% Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified:
<covered lines added or modified>/<coverable lines added or modified> * 100%
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/core/algorithms/flips.rs`:
- Around line 4386-4395: The test
test_delaunay_repair_error_boxes_large_flip_sources incorrectly expects
Error::source() to expose a Box<FlipError>; change the downcast to look for
FlipError directly (use downcast_ref::<FlipError>()) because #[source] on a
Box<T> returns &T; update the assertion that extracts the source accordingly
while keeping the Flip { source } variant handling unchanged.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yml
Review profile: CHILL
Plan: Pro
Run ID: 89115868-4a35-4c12-82e6-1c244dc21246
📒 Files selected for processing (8)
src/core/algorithms/flips.rssrc/core/algorithms/incremental_insertion.rssrc/delaunay/construction.rssrc/delaunay/repair.rssrc/geometry/matrix.rssrc/geometry/traits/coordinate.rssrc/lib.rstests/prelude_exports.rs
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #407 +/- ##
==========================================
+ Coverage 90.50% 90.51% +0.01%
==========================================
Files 71 71
Lines 62187 62244 +57
==========================================
+ Hits 56281 56340 +59
+ Misses 5906 5904 -2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Add coverage for converting a boxed `DelaunayRepairError::Flip` source into `FlipNeighborRepairFailure::Flip` while preserving the derived flip failure kind.
DelaunayRepairError::Flipsources while preserving typedFlipErrorinspection throughFrom<FlipError>andError::source.BREAKING CHANGE:
DelaunayRepairError::Flipis now a named variant withsource: Box<FlipError>instead of the tuple variantFlip(FlipError). Callers that pattern-match this variant must useFlip { source }or construct it throughDelaunayRepairError::from.Closes #384