Skip to content

argh_shared: change serde features to allow no_std use#183

Open
wgwoods wants to merge 1 commit intogoogle:masterfrom
wgwoods:patch-1
Open

argh_shared: change serde features to allow no_std use#183
wgwoods wants to merge 1 commit intogoogle:masterfrom
wgwoods:patch-1

Conversation

@wgwoods
Copy link

@wgwoods wgwoods commented Jan 17, 2024

The argh_shared crate depends on serde, which uses std in its default configuration. This makes it incompatible with no_std crates.

As per the serde docs, adding default-features = false makes it support no_std, and adding the alloc feature lets it opt back into memory allocation so it can still handle Strings and such, which is (probably) important here.

This could probably also be accomplished by adding a default-on std feature that could be turned off by no_std users, but since argh's stated goal is small code size it seemed like defaulting to no_std-compatibility was the sanest & simplest change.

The `argh_shared` crate depends on `serde`, which uses `std` in its default configuration. This makes it incompatible with `no_std` crates.

As per the [`serde` docs](https://serde.rs/no-std.html), adding `default-features = false` makes it support `no_std`, and adding the `alloc` feature lets it opt back into memory allocation so it can still handle `String`s and such.
@sadmac7000
Copy link
Collaborator

Fancy running in to you XD

Looks like the CLA checker might be bugged out but I'll submit this when it gets sorted.

@sadmac7000
Copy link
Collaborator

Looks like you'll need to sign the Google CLA for us to land this.

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