Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example in metrics docs does not work with latest released metrics-macros #315

Closed
danielnelson opened this issue Jul 21, 2022 · 2 comments
Closed
Labels
C-macros Component: macros. E-simple Effort: simple. T-bug Type: bug.

Comments

@danielnelson
Copy link
Contributor

This issue is a bit of a nag, sorry if you are already aware of it.

The docs for the new metrics-0.20.0 show an example for describe_counter:

describe_counter!("some_metric_name", "my favorite counter");

But after updating I tried to compile:

error[E0308]: mismatched types
 --> examples/describe.rs:4:45
  |
4 |     describe_counter!("requests_processed", "number of requests processed");
  |                                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected struct `metrics::cow::Cow`, found `&str`
  |
  = note: expected struct `metrics::cow::Cow<'static, str>`
          found reference `&'static str`

In order for this to work, I believe there needs to be a new release of metrics-macros with the changes from #312.

In the meantime, this works okay:

describe_counter!("some_metric_name", "my favorite counter".into());
@tobz
Copy link
Member

tobz commented Jul 22, 2022

Dangit! Nope, not a nag at all. I missed the fact I needed to cut a release of metrics-macros.

Good eye and thank you for reporting. 👍🏻

@tobz tobz added C-macros Component: macros. E-simple Effort: simple. T-bug Type: bug. S-awaiting-release Status: awaiting a release to be considered fixed/implemented. labels Jul 22, 2022
@tobz
Copy link
Member

tobz commented Jul 22, 2022

Alright, released metrics-macros@v0.6.0 which includes the changes related to SharedString, and released metrics@v0.20.1 which correctly uses that new version. Likewise, I yanked metrics@v0.20.0 to avoid users picking up that broken version going forward.

Thank you again for spotting and reporting this so quickly. ❤️

@tobz tobz closed this as completed Jul 22, 2022
@tobz tobz removed the S-awaiting-release Status: awaiting a release to be considered fixed/implemented. label Jul 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-macros Component: macros. E-simple Effort: simple. T-bug Type: bug.
Projects
None yet
Development

No branches or pull requests

2 participants