Skip to content

fix: qualify ToProto calls on foreign receivers - #7437

Merged
suzmue merged 1 commit into
googleapis:mainfrom
suzmue:qualify-foreign-receivers
Nov 10, 2026
Merged

suzmue merged 1 commit into
googleapis:mainfrom
suzmue:qualify-foreign-receivers

Conversation

@suzmue

@suzmue suzmue commented Nov 10, 2026

Copy link
Copy Markdown
Contributor

Calls such as self.code.to_proto() rely on inference to pick the ToProto<T> impl for a type defined in another crate. If a future release of that crate adds a second impl for the same type, these calls become ambiguous and stop compiling. Name the trait parameter explicitly, as the generated code already does.

For #7284

Calls such as `self.code.to_proto()` rely on inference to pick the
`ToProto<T>` impl for a type defined in another crate. If a future release
of that crate adds a second impl for the same type, these calls become
ambiguous and stop compiling. Name the trait parameter explicitly, as the
generated code already does.
@suzmue
suzmue requested review from a team as code owners November 10, 2026 22:26

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates several calls to '.to_proto()' across the 'firestore', 'pubsub', and 'storage' crates to use explicit fully-qualified trait syntax (e.g., 'ToProto::::to_proto(...)') instead of method call syntax. This resolves type inference ambiguities for the 'ToProto' trait conversions. I have no feedback to provide as the changes are straightforward and correct.

@suzmue
suzmue enabled auto-merge (squash) November 10, 2026 22:36
@suzmue
suzmue merged commit 269379e into googleapis:main Nov 10, 2026
43 checks passed
@codecov

codecov Bot commented Nov 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.66%. Comparing base (5544fcd) to head (9376501).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #7437   +/-   ##
=======================================
  Coverage   98.66%   98.66%           
=======================================
  Files         334      334           
  Lines      147687   147688    +1     
=======================================
+ Hits       145722   145723    +1     
  Misses       1965     1965           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants