Skip to content

cleanup(pubsub): add must_use attribute to publish#4951

Open
suzmue wants to merge 3 commits intogoogleapis:mainfrom
suzmue:mustuse
Open

cleanup(pubsub): add must_use attribute to publish#4951
suzmue wants to merge 3 commits intogoogleapis:mainfrom
suzmue:mustuse

Conversation

@suzmue
Copy link
Collaborator

@suzmue suzmue commented Mar 9, 2026

Fixes #4950

@suzmue suzmue requested a review from a team as a code owner March 9, 2026 17:30
@product-auto-label product-auto-label bot added the api: pubsub Issues related to the Pub/Sub API. label Mar 9, 2026
@codecov
Copy link

codecov bot commented Mar 9, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.93%. Comparing base (7b3a369) to head (335936d).
⚠️ Report is 6 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4951      +/-   ##
==========================================
- Coverage   93.94%   93.93%   -0.02%     
==========================================
  Files         221      221              
  Lines        8538     8538              
==========================================
- Hits         8021     8020       -1     
- Misses        517      518       +1     

☔ View full report in Codecov by Sentry.
📢 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.

Comment on lines +495 to +496
let handle = publisher.publish(msg.clone());
drop(handle);
Copy link
Member

Choose a reason for hiding this comment

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

will clippy let us say:

Suggested change
let handle = publisher.publish(msg.clone());
drop(handle);
let _ = publisher.publish(msg.clone());

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

Labels

api: pubsub Issues related to the Pub/Sub API.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Mark publish() as must_use

2 participants