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

Ensure trace noop structs use new #240

Merged
merged 4 commits into from
Oct 3, 2020
Merged

Conversation

jtescher
Copy link
Member

@jtescher jtescher commented Oct 3, 2020

Add private fields to trace module's noop structs to be consistent with this crate's conventions around backwards compatibility.

@jtescher jtescher requested a review from a team October 3, 2020 18:06
Copy link
Member

@frigus02 frigus02 left a comment

Choose a reason for hiding this comment

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

👍

Copy link
Contributor

@TommyCpp TommyCpp 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 👍. This should work, but is there a reason why we don't use #[non_exhaustive] in this case?

@jtescher
Copy link
Member Author

jtescher commented Oct 3, 2020

@TommyCpp we don't want to allow matching at all, rather than merely non exhaustive matching, but this is more about the constructor specifically. By default constructors via NoopSpan {} are public, this change makes users go through NoopSpan::new() instead so if we want to add some state or otherwise change the internals this makes it not a breaking change.

@jtescher jtescher merged commit d7c7831 into master Oct 3, 2020
@jtescher jtescher deleted the private-noop-constructors branch October 3, 2020 19:59
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.

3 participants