magiclen / base64-url

Base64 encode, decode, escape and unescape for URL applications.
MIT License
9 stars 0 forks source link

Why was `std` feature deprecated? #6

Closed nathanielc closed 6 months ago

nathanielc commented 7 months ago

See https://github.com/magiclen/base64-url/blob/master/Cargo.toml#L21

Its no longer possible to enable the std feature on the base64 dependency with a feature on this crate. Is it expected that all consumers of base64-url that want to use base64/std must explicitly state base64 as a dependency?

magiclen commented 7 months ago

Yes, since base64-url itself does not actually utilize the std feature, so I think it should not be a default feature and should be considered for removal in the future.

nathanielc commented 6 months ago

Ok, I ran into an issue where I could not build my project which depends on base64-url. The issue was that I was trying to convert an error returned from decode into a dyn StdError. However since I base64-url does not enable the std future the decode error returned does not implement the StdError trait.

With cargo there isn't a way to enable features for dependencies of dependencies. To fix the build I had to add base64 as an explicitly dependency and enable the feature directly. See https://github.com/ceramicnetwork/rust-dag-jose/pull/31

Since base64-url re-exports types from base64 it would be useful to also expose a std feature that simply enables the std feature of base64.

magiclen commented 6 months ago

Given your strong recommendation, I will go with it.

nathanielc commented 6 months ago

Thanks!