And Rust said, "Let there be units".
Hurray! Now you can work with units of measure in a headache-free way.
Currently available units:
- Length
- Temperature
- Weight
Example
In your Cargo.toml...
[dependencies]
measurements = "^0.2.0"
In your code...
extern crate measurements;
use ;
let football_field = from_yards;
let meters = football_field.as_meters;
println!;
let boiling_water = from_celsius;
let fahrenheit = boiling_water.as_fahrenheit;
println!;
let metric_ton = from_metric_tons;
let united_states_tons = metric_ton.as_short_tons;
let united_states_pounds = metric_ton.as_pounds;
println!;
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.