You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
One thing that came up in the review was that it's easy to forget to call .send() on the MetricBuilder. And if you do, there's no warning.
So I was wondering, have you considered annotating MetricBuilder with #[must_use]? I gave it a quick try locally and it seems to work nicely, it results in a warning like this:
warning: unused cadence::builder::MetricBuilder which must be used
It prints that warning if you just have a mark_with_tags(...) and even when you have mark_with_tags(...).with_tag(...) (but forgot send).
The text was updated successfully, but these errors were encountered:
While we have the example in the description, have you considered adding an alternative to the send method that ignores any errors instead of returning a result? Currently, not calling .ok() on the Result results in a warning.
I just updated my code to make use of tags (thanks for adding it, works great!). Now I have this code for example:
One thing that came up in the review was that it's easy to forget to call
.send()
on theMetricBuilder
. And if you do, there's no warning.So I was wondering, have you considered annotating
MetricBuilder
with#[must_use]
? I gave it a quick try locally and it seems to work nicely, it results in a warning like this:It prints that warning if you just have a
mark_with_tags(...)
and even when you havemark_with_tags(...).with_tag(...)
(but forgotsend
).The text was updated successfully, but these errors were encountered: