-
Notifications
You must be signed in to change notification settings - Fork 227
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
Serde no_std compatibility #288
base: main
Are you sure you want to change the base?
Serde no_std compatibility #288
Conversation
Weird failure in the MSRV test. Wonder if it's a nightly bug in the unused import diagnostic. @semenov-vladyslav maybe try pinning a slightly older nightly? |
Looks like clippy failed on unused imports. Forgot to update cfg pragma to a few other imports. Essentially, "serde" feature requires one of "std" or "alloc". Fixed that, now it should work. |
Looks like we didn't use We should probably add that: Adding a test here to CI: #289 - checking that this fails as expected. |
Confirming no_std build works in main without serde: However with serde it fails as expected: Can we re-base this when the test PR in CI so we ensure in CI it's fixed. |
as an alternative to dalek-cryptography#288 this updates serde `Serialize` and `Deserialize` implementations to use a custom visitor, removing the need for `alloc` or `std` for embedded use, and making this consistent with implementations in [curve25519-dalek](https://github.com/dalek-cryptography/curve25519-dalek/blob/a63e14f4ded078d6bf262ba0b3f47026bdd7f7c0/src/edwards.rs#L269). @pinkforest seems like it'd be good to have some serde tests / this should go over dalek-cryptography#289? Co-Authored-By: Vlad Semenov <[email protected]>
…lize` and `Deserialize` implementations to use a custom visitor, removing the need for `alloc` or `std` for embedded use, and making this consistent with implementations in [curve25519-dalek](https://github.com/dalek-cryptography/curve25519-dalek/blob/a63e14f4ded078d6bf262ba0b3f47026bdd7f7c0/src/edwards.rs#L269). @pinkforest seems like it'd be good to have some serde tests / this should go over dalek-cryptography#289? Co-Authored-By: Vlad Semenov <[email protected]>
This PR addresses issue #287. Tests pass with different combinations of features: "serde", "serde alloc", "serde std", "alloc".