fix(internal/librarian/rust): map recursive fields to Box#4074
fix(internal/librarian/rust): map recursive fields to Box#4074coryan merged 1 commit intogoogleapis:mainfrom
Conversation
Recursive fields that are not repeated or oneof should be mapped to Box.
There was a problem hiding this comment.
Code Review
This pull request introduces logic to detect when prost will box a recursive field and updates the code generation templates accordingly. The core detection logic in mapToBoxed appears sound. However, there are a couple of issues. A test case for a map with a recursive value has an incorrect expectation for whether the field will be boxed. Additionally, the new template logic for converting to the prost type is missing a necessary dereference for boxed types, which will cause a compilation error. I've left specific comments with suggestions to address these points.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4074 +/- ##
=======================================
Coverage 81.93% 81.93%
=======================================
Files 78 78
Lines 6516 6516
=======================================
Hits 5339 5339
Misses 832 832
Partials 345 345 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Recursive fields that are not repeated or oneof should be mapped to Box.