Ten0 / serde_avro_fast

An idiomatic implementation of serde/avro (de)serialization
GNU Lesser General Public License v3.0
20 stars 4 forks source link

avoid using `std` feature in rust_decimal #19

Closed droundy closed 4 months ago

droundy commented 4 months ago

This reduces the number of dependencies, and cargo check and cargo test still run fine.

It came up because I was setting up cargo vet in my code, and was surprised to see rkyv in our list of dependencies. It'll be nice to have fewer dependencies to audit, and rkyv would be a particularly hefty crate to audit.

Of course, it's also nice for compile times to avoid depending on so many crates.

Ten0 commented 4 months ago

It seems to be incorrect that rkyv is enabled by rust_decimal if the rust_decimal/std feature is enabled. It's only enabled if the rust_decimal/rkyv feature is also enabled. Note the presence of the ? here (documentation). It gets resolved in the Cargo.lock for some reason, but cargo check will not compile it, nor does it appear in cargo tree.

The fact it appears in Cargo.lock here but not if the std feature is not enabled seems to be more a Rust issue: I don't think it should be resolved there... I'd guess that's probably a hack on their end to enable the feature conditionally on the crate being a dep of something else.

It's also probably an issue at cargo vet: it probably shouldn't complain about something that doesn't appear in cargo tree.

The rationale behind enabling this feature was: