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

fix: correct SerializeField definition #3040

Merged
merged 1 commit into from
Jul 29, 2024

Conversation

hds
Copy link
Contributor

@hds hds commented Jul 26, 2024

Motivation

Clippy in 1.80.0 alerted us to the fact that SerializeField was never
constructed (and due to its non-pub member, it can't be constructed
outside the tracing-serde crate where it's from).

Solution

This change fixes the definition to hold a reference to a Field, which
is what the other Serialize* types do. It also implements AsSerde
for this type and uses it inside the SerializeFieldSet type.

As a bonus, Clippy is now also happy that the type is constructed.

The example collector in the tracing-serde crate was also renamed from
JsonSubscriber to JsonCollector.

@hds hds requested review from hawkw, davidbarsky and a team as code owners July 26, 2024 14:53
Clippy in 1.80.0 alerted us to the fact that `SerializeField` was never
constructed (and due to its non-`pub` member, it can't be constructed
outside the `tracing-serde` crate where it's from).

This change fixes the definition to hold a reference to a `Field`, which
is what the other `Serialize*` types do. It also implements `AsSerde`
for this type and uses it inside the `SerializeFieldSet` type.

As a bonus, Clippy is now also happy that the type is constructed.

The example collector in the `tracing-serde` crate was also renamed from
`JsonSubscriber` to `JsonCollector`.

Some additional doc formatting issues in `tracing-subscriber` were fixed
so that list items that run to multiple lines are correctly indented.
@hds hds force-pushed the hds/tracing-serde-serialize-field-fix branch from 5776262 to cfa24f8 Compare July 29, 2024 10:14
@davidbarsky davidbarsky merged commit acf92ab into master Jul 29, 2024
56 checks passed
@davidbarsky davidbarsky deleted the hds/tracing-serde-serialize-field-fix branch July 29, 2024 18:54
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.

2 participants