rust-embedded-community / rust-measurements

Metric, Imperial, and other measurement handling for Rust. Length, Temperature, Weight, and Volume
https://crates.io/crates/measurements
27 stars 10 forks source link

Add functionality to get Temperature from string #28

Closed drodil closed 3 years ago

drodil commented 3 years ago

This functionality adds possibility to pass a string value to create new Temperature unit. If the string value ends with the symbol of the unit, it will create a Temperature from that unit, otherwise it will default to Celsius. Empty string values are considered also as 0.0 degrees Celsius.

Additionally this same can be added to other units as well but I am first looking forward from hearing from you what do you think? We actually created builders for this in our project https://github.com/drodil/rustybeer so that user can input units easily from the command line.

drodil commented 3 years ago

True. I can add it and then work on other units as well 👍

drodil commented 3 years ago

Ok, sounds good to me. Could you also squash the commits into one?

Sure thing, done!

drodil commented 3 years ago

Great! Please merge when you can; I will continue with other units after that!

eldruin commented 3 years ago

Merged, thank you!