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 Debug impls and fix clippy warnings #71

Merged
merged 4 commits into from Jul 15, 2022

Conversation

Victor-N-Suadicani
Copy link
Contributor

Lots of public types are missing Debug impls. I've added most of the easy Debug impls and also added #![warn(missing_debug_implementations)] to the top level.

There are also quite a few Clippy warnings that have been fixed.

Copy link
Member

@mxinden mxinden left a comment

Choose a reason for hiding this comment

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

Thanks for the work here @Victor-N-Suadicani!

@@ -1,6 +1,7 @@
#![forbid(unsafe_code)]
#![deny(unused)]
#![deny(dead_code)]
#![warn(missing_debug_implementations)]
Copy link
Member

Choose a reason for hiding this comment

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

I am a bit undecided. I don't think we should be adding Debug implementations to types by default as it slows compile time and bloats the compiled binary.

Do you feel strongly about this? What do you think of removing this line but keeping the new derive statements below?

Suggested change
#![warn(missing_debug_implementations)]

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This only lints for public types I believe. So it's not every type.

But I don't feel super strongly about it. Though I think it is a good idea.

Your call :)

Copy link
Member

Choose a reason for hiding this comment

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

This only lints for public types I believe. So it's not every type.

Good point. Thanks. Let's keep it as is then.

src/encoding/text.rs Show resolved Hide resolved
Copy link
Member

@mxinden mxinden left a comment

Choose a reason for hiding this comment

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

Looks good to me. Only missing a changelog entry for the added Debug implementations.

@@ -1,6 +1,7 @@
#![forbid(unsafe_code)]
#![deny(unused)]
#![deny(dead_code)]
#![warn(missing_debug_implementations)]
Copy link
Member

Choose a reason for hiding this comment

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

This only lints for public types I believe. So it's not every type.

Good point. Thanks. Let's keep it as is then.

Signed-off-by: Victor Nordam Suadicani <v.n.suadicani@gmail.com>
Signed-off-by: Victor Nordam Suadicani <v.n.suadicani@gmail.com>
Signed-off-by: Victor Nordam Suadicani <v.n.suadicani@gmail.com>
Signed-off-by: Victor Nordam Suadicani <v.n.suadicani@gmail.com>
Copy link
Member

@mxinden mxinden left a comment

Choose a reason for hiding this comment

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

Thanks @Victor-N-Suadicani. I will cut a new release soon.

@mxinden mxinden merged commit 33825bc into prometheus:master Jul 15, 2022
ackintosh pushed a commit to ackintosh/client_rust that referenced this pull request Aug 27, 2022
Signed-off-by: Victor Nordam Suadicani <v.n.suadicani@gmail.com>
Signed-off-by: ackintosh <sora.akatsuki@gmail.com>
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.

None yet

2 participants