Hurray! Now you can work with units of measure in a headache-free way.
Currently available units:
In your Cargo.toml...
[dependencies]
measurements = "^0.2.0"
In your code...
```rust extern crate measurements;
use measurements::{Length, Temperature, Weight};
let footballfield = Length::fromyards(100.0); let meters = footballfield.asmeters(); println!("There are {} meters in a football field.", meters);
let boilingwater = Temperature::fromcelsius(100.0); let fahrenheit = boilingwater.asfahrenheit(); println!("Boiling water measures at {} degrees fahrenheit.", fahrenheit);
let metricton = Weight::frommetrictons(1.0); let unitedstatestons = metricton.asshorttons(); let unitedstatespounds = metricton.aspounds(); println!("One metric ton is {} U.S. tons - that's {} pounds!", unitedstatestons, unitedstatespounds); ```
References
I am by no means a measurement or math expert, I simply wanted to do something useful while learning Rust. Thank you to these sites and their authors for the great reference material used in building this library.