Changed: Use borrowed APIs in utility functions#190
Conversation
Updates `into_hashmap`, `dedup_vertices_exact`, `dedup_vertices_epsilon`, and `filter_vertices_excluding` functions to accept slices instead of vectors, improving performance by avoiding unnecessary cloning. This aligns with the Rust agent's preference for borrowed APIs, taking references as arguments and returning borrowed views when possible, and only taking ownership when required. Refs: refactor/borrow-first-utils
WalkthroughPublic APIs were changed to prefer borrowed inputs: methods accepting owned Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
No actionable comments were generated in the recent review. 🎉 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 |
Coverage summary from CodacySee diff coverage on Codacy
Coverage variation details
Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: Diff coverage details
Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: See your quality gate settings Change summary preferences |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #190 +/- ##
==========================================
- Coverage 63.09% 63.08% -0.01%
==========================================
Files 46 46
Lines 10031 10031
==========================================
- Hits 6329 6328 -1
- Misses 3702 3703 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Refactors `into_hashmap` functions for `Cell` and `Vertex` to accept iterators instead of vectors. This improves flexibility by allowing any iterable collection to be converted into a hashmap, and reduces unnecessary allocations by avoiding intermediate vector copies.
Updates
into_hashmap,dedup_vertices_exact,dedup_vertices_epsilon, andfilter_vertices_excludingfunctions to accept slices instead of vectors, improving performance by avoiding unnecessary cloning.This aligns with the Rust agent's preference for borrowed APIs, taking references as arguments and returning borrowed views when possible, and only taking ownership when required.
Refs: refactor/borrow-first-utils