refactor(net): expose route cost fields - #3802
Conversation
|
Warning Review limit reachedNext included review available in 5 minutes. View limit detailsLimit details: You’ve used all 4 included reviews currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (9)
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (8)
💤 Files with no reviewable changes (4)
Included review availability: Your plan provides up to 4 included reviews per hour; 1 remains after this review. WalkthroughThe public Priority: ➖ Normal 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 75.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 3 files. (1 skipped: 1 unsupported.) ✨ Finishing Touches✨ Simplify code
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Verdict: request changes |
| } | ||
|
|
||
| /// A discounted warm cost alongside the same route's undiscounted cold cost. | ||
| pub const fn from_warm_cold(warm: u64, cold: u64) -> Self { |
There was a problem hiding this comment.
I'm not a fan. IMO it's better to require Cost { warm: x, cold: y } instead of from_warm_cold(x, y)
d3eaae3 to
91f5c86
Compare
Verdict: request changes |
91f5c86 to
f8ec26f
Compare
Verdict: request changes |
f8ec26f to
344d6f8
Compare
|
Co-Authored-By: GPT-5 <noreply@openai.com>
Co-Authored-By: GPT-5 <noreply@openai.com>
Co-Authored-By: GPT-5 <noreply@openai.com>
344d6f8 to
51f739a
Compare
Verdict: request changes |
Co-Authored-By: GPT-5 <noreply@openai.com>
Verdict: request changes |






Problem
Route construction exposed a fallible single-hop builder and an unnamed tuple conversion for warm and cold costs. Callers had to infer tuple positions, while
Costbeing non-exhaustive prevented the clearest named construction.Approach
Costexhaustively constructible with its publicwarmandcoldfields.Hopsbefore constructing aRoutewithCost { warm, cold }.Route::with_hopand complete the route-cost quest.Impact
Route::with_hopandFrom<(u64, u64)> for Cost; callers buildHops, callRoute::with_hops, and constructCost { warm, cold }.#[non_exhaustive]fromCost, allowing downstream struct literals and exhaustive destructuring.Cost::from_warm_coldconstructor is added.Alternatives
A named constructor was considered, but the public fields already provide the shortest and clearest named construction without growing the API.
Testing
just checkjust rs test -p moq-net -p moq-ffi -p libmoq: 1,457 passedFollow-ups
None.
(written by GPT-5)