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

Avoid using serde just for printing debug representations #1719

Merged
merged 1 commit into from
Aug 25, 2023

Conversation

mhammond
Copy link
Member

@mhammond mhammond commented Aug 24, 2023

There were a lot of places where we derived Serialize just so a command-line tool could dump a JSON repr of a CI. Everything dumped also derives Debug, so now we just prefer using {:#?} and avoid using serde except where we actually need it (which is largely limited to parsing toml)

@mhammond mhammond requested a review from bendk August 24, 2023 16:03
@mhammond mhammond requested a review from a team as a code owner August 24, 2023 16:03
@mhammond mhammond force-pushed the unused-serde branch 4 times, most recently from 34f74dd to 5db038c Compare August 24, 2023 19:05
Copy link
Contributor

@bendk bendk left a comment

Choose a reason for hiding this comment

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

Seems good to me. As long as the output is human-readable it should be fine.

@mhammond
Copy link
Member Author

clap-rs/clap#5088

@epage
Copy link

epage commented Aug 25, 2023

RE 5088

Clap is working as-expected.

Libraries should not be making policy decisions for their dependents by constraining upper bounds on version requirements. In fact doing so can be harmful to the entire ecosystem. We only do it for clap/clap_builder/clap_derive due to a special case related to proc macros. See https://doc.rust-lang.org/nightly/cargo/reference/specifying-dependencies.html#multiple-requirements for more details.

Instead, if you care about MSRV, you likely should be committing your lockfile. Note that Cargo has changed its guidance (blog post on this is upcoming). See the new guidance on the nightly docs: https://doc.rust-lang.org/nightly/cargo/faq.html#why-have-cargolock-in-version-control

uniffi/Cargo.toml Outdated Show resolved Hide resolved
@mhammond mhammond merged commit cae8edc into mozilla:main Aug 25, 2023
@mhammond mhammond deleted the unused-serde branch August 25, 2023 17: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.

4 participants