parallelsystems / bit-struct

ergonomic bitfields in Rust
12 stars 3 forks source link

Move serde to optional feature and remove mandatory downstream dependency #15

Closed JarredAllen closed 1 year ago

JarredAllen commented 1 year ago

Background

See issue #13

Description

Makes serde an optional dependency and enables it to work in crates which don't have serde listed as an explicit dependency in their Cargo.toml.

I defaulted the feature to be present to minimize disruptions with existing uses of this crate that may rely on the serde implementations. However, it is still backwards-incompatible if anyone was relying on serde and already disabled the default features (idk why they would when there aren't any features).

Closes #13

Verification

All tests pass, with or without the serde feature.

Also, I made a new crate locally which depends on this crate with the serde feature, and doesn't import serde (the case which would fail previously), and observed that it builds fine with both a bit_struct! and an enums! invocation.

andrewgazelka commented 1 year ago

can you fix

image

Thanks

JarredAllen commented 1 year ago

can you fix

image

Thanks

I'm not sure what you're referencing, as there is no use crate::enums on line 9 of src/types.rs and cargo clippy for me does not produce that lint.

I did spend a while working with that warning popping up. Is it possible you're somehow on an outdated commit hash when you ran that command?

andrewgazelka commented 1 year ago

oh ok. LGTM