bcmyers / num-format

A Rust crate for producing string representations of numbers, formatted according to international standards
Apache License 2.0
123 stars 22 forks source link

Added impls to CustomFormat #8

Closed loewenheim closed 5 years ago

loewenheim commented 5 years ago

This implements From<Locale> and From<Environment> for CustomFormat.

Fixes #6.

bcmyers commented 5 years ago

Hi @loewenheim. Thanks for the PR! This seems to be failing because Environment is not available in a no_std build (because I don't think you can get your system locale if there's no OS). Any use of Environment has to sit behind a #[cfg(feature = "std")] flag or else cargo test --no-default-features will fail.

Would you like to take another crack at this? I could implement it quickly, but I'm guessing it would be nice to encourage more authors than just me to show up in the commit history and I'm happy to facilitate that.

Also - Note that per a recommendation from BurntSushi, I've heavily flattened the module structure; so it might be best to start from the latest master.

loewenheim commented 5 years ago

Thank you very much for the guidance! I definitely appreciate you letting me try this again.