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

Add blanket implementations of Recorder for some pointer-like types #507

Closed
wants to merge 7 commits into from

Conversation

david-perez
Copy link
Contributor

Rc, Arc, and Box.

Closes #506.

Copy link
Member

@tobz tobz left a comment

Choose a reason for hiding this comment

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

Just one small nit to have the code be a little more idiomatic.

T: Recorder,
{
fn describe_counter(&self, key: KeyName, unit: Option<Unit>, description: SharedString) {
Deref::deref(self).describe_counter(key, unit, description)
Copy link
Member

Choose a reason for hiding this comment

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

You should be able to just do (**self), or even self.as_ref(), which I think are both a bit more idiomatic than Deref::deref(self). Dealer's choice on which one you choose... but just not Deref::deref(self). 😂

@tobz
Copy link
Member

tobz commented Sep 5, 2024

Closing in favor of #512. (explanation is in the new PR)

@tobz tobz closed this Sep 5, 2024
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.

Routing more than one pattern to the same Recorder
5 participants