Skip to content
New issue

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

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

Already on GitHub? # 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
@hds hds mentioned this pull request Nov 19, 2024
20 tasks
hds added a commit that referenced this pull request Nov 22, 2024
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 added a commit that referenced this pull request Nov 22, 2024
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 added a commit that referenced this pull request Nov 27, 2024
# 0.2.0 (November 27, 2024)

[ [crates.io][crate-0.2.0] ] | [ [docs.rs][docs-0.2.0] ]

<a id = "0.2.0-breaking"></a>
### Breaking Changes

- Correct SerializeField definition and doc formatting ([#3040])
  `SerializeField` has gained a generic lifetime parameter.

### Fixed

- Implement `AsSerde` for `FieldSet` ([#2241])
- [**breaking**](#0.2.0-breaking) Correct SerializeField definition and doc formatting ([#3040])

### Changed

- Bump MSRV to 1.63 ([#2793])

[#2241]: #2241
[#3040]: #3040
[docs-0.2.0]: https://docs.rs/tracing-serde/0.2.0/tracing-serde/
[crate-0.2.0]: https://crates.io/crates/tracing-serde/0.2.0
hds added a commit that referenced this pull request Nov 27, 2024
# 0.2.0 (November 27, 2024)

[ [crates.io][crate-0.2.0] ] | [ [docs.rs][docs-0.2.0] ]

<a id = "0.2.0-breaking"></a>
### Breaking Changes

- Correct SerializeField definition and doc formatting ([#3040])
  `SerializeField` has gained a generic lifetime parameter.

### Fixed

- Implement `AsSerde` for `FieldSet` ([#2241])
- [**breaking**](#0.2.0-breaking) Correct SerializeField definition and doc formatting ([#3040])

### Changed

- Bump MSRV to 1.63 ([#2793])

[#2241]: #2241
[#3040]: #3040
[docs-0.2.0]: https://docs.rs/tracing-serde/0.2.0/tracing-serde/
[crate-0.2.0]: https://crates.io/crates/tracing-serde/0.2.0
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants