Skip to content

Allow using postcard without serde derive #219

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dtolnay
Copy link
Contributor

@dtolnay dtolnay commented Mar 8, 2025

Postcard unconditionally enabled serde's "derive" feature (serde_derive dependency) even though the derive is only used for a single type inside postcard (#215). This PR handwrites the Serialize and Deserialize impls for that type and turns off the derive dependency, except for tests.

Before:

postcard v1.1.1
├── cobs v0.2.3
├── heapless v0.7.17
│   ├── hash32 v0.2.1
│   │   └── byteorder v1.5.0
│   ├── serde v1.0.218
│   │   └── serde_derive v1.0.218 (proc-macro)
│   │       ├── proc-macro2 v1.0.94
│   │       │   └── unicode-ident v1.0.18
│   │       ├── quote v1.0.39
│   │       │   └── proc-macro2 v1.0.94 (*)
│   │       └── syn v2.0.99
│   │           ├── proc-macro2 v1.0.94 (*)
│   │           ├── quote v1.0.39 (*)
│   │           └── unicode-ident v1.0.18
│   ├── spin v0.9.8
│   │   └── lock_api v0.4.12
│   │       └── scopeguard v1.2.0
│   │       [build-dependencies]
│   │       └── autocfg v1.4.0
│   └── stable_deref_trait v1.2.0
│   [build-dependencies]
│   └── rustc_version v0.4.1
│       └── semver v1.0.26
└── serde v1.0.218 (*)

After:

postcard v1.1.1
├── cobs v0.2.3
├── heapless v0.7.17
│   ├── hash32 v0.2.1
│   │   └── byteorder v1.5.0
│   ├── serde v1.0.218
│   ├── spin v0.9.8
│   │   └── lock_api v0.4.12
│   │       └── scopeguard v1.2.0
│   │       [build-dependencies]
│   │       └── autocfg v1.4.0
│   └── stable_deref_trait v1.2.0
│   [build-dependencies]
│   └── rustc_version v0.4.1
│       └── semver v1.0.26
└── serde v1.0.218

Copy link

netlify bot commented Mar 8, 2025

Deploy Preview for cute-starship-2d9c9b canceled.

Name Link
🔨 Latest commit 87867ca
🔍 Latest deploy log https://app.netlify.com/sites/cute-starship-2d9c9b/deploys/67cbbe1e52ee55000895e14e

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.

1 participant