maciejhirsz / tiny-bip39

A Rust implementation of BIP-0039
Apache License 2.0
65 stars 37 forks source link

Construct Language from string language codes #15

Closed dusty-phillips closed 4 years ago

dusty-phillips commented 4 years ago

This facilitates choosing a language from user-provided input. Since the input could be invalid it returns an Option.

I got the language codes from https://www.w3schools.com/tags/ref_language_codes.asp

dusty-phillips commented 4 years ago

Whoops. Good catch. I've pushed the conditional compilation on match arms.

I also discovered that it was failing to compile tests with --no-default-features due to a lack of conditional compilation in the validation tests. A second commit in this pullrequest also fixes that problem.

maciejhirsz commented 4 years ago

Cheers, published on crates in 0.7.2.