KokaKiwi / rust-hex

A basic crate to encode values to hexadecimal representation. Originally extracted from rustc-serialize.
https://crates.io/crates/hex
Apache License 2.0
201 stars 55 forks source link

Use const-generics to implement FromHex trait #58

Open Luro02 opened 3 years ago

Luro02 commented 3 years ago

In rust version 1.51 a small subset of const-generics has been stabilized, which removes the need for the previously used macro.

Because of the widespread use of this crate and previous issues with minor versions breaking the msrv of this crate, I would suggest making this PR part of the 0.5.0 release.

KokaKiwi commented 3 years ago

I really would love to use const-generics to replace these awful "magic-number thingy impls", but i think it would need some requirements, like a MSRV set for hex. And as said in https://github.com/KokaKiwi/rust-hex/pull/56#issuecomment-860208808, this matter would require some discussion ^^

Also there's stuff i would like to try to make hex more retro-compatible by using some build-time crate like rustversion with some parts of code conditioned with #[rustversion::since(1.51)] for example. But that would actually be the kind of stuff i would like to discuss relating to setting a MSRV for hex