dylanhart / ulid-rs

This is a Rust implementation of the ulid project
https://crates.io/crates/ulid
MIT License
389 stars 37 forks source link

All feature combinations compile #60

Open TimLuq opened 1 year ago

TimLuq commented 1 year ago

It was previously possible to disable the default std feature which caused the compilation to fail if the serde or uuid features were active. There were also tests which caused compilation errors when not building tests with the std feature.

This will however require rust 1.60 or higher due to the use of weak dependency features (i.e. std = ["rand", "serde?/std", "uuid?/std"]). This is a bump from the previous need for somewhere around 1.46-1.54 depending on compilation parameters. The documentation is also extended to include which features are needed for specific fns.

The new implementation for serde no longer does any heap allocation, so it is completely safe to use in a no_std context. It can also sneakily deserialize all reasonable kinds of data without the need to override with deserialize_with if the Deserializer supports it.

Fixes #57 and the specific use case in #52.