3 ms·
This is the one area I most sorely miss in Rust. Not that I don’t miss it anywhere else (I absolutely do, currently writing lots of TS and trying to make do wit
by baq 3y ago
This is the one area I most sorely miss in Rust. Not that I don’t miss it anywhere else (I absolutely do, currently writing lots of TS and trying to make do with nominal types), but that it’s a very important safety mechanism in all of engineering and a unit/system of measure built into the language would fit so well.
- adrianN 3y agoJust use a crate? First Google hit https://docs.rs/uom/latest/uom/ https://docs.rs/uom/latest/uom/
- hedora 3y agoThat looks nice, but appears to only handle SI.
- nequo 3y agoThe crate defines square feet etc.: https://docs.rs/uom/latest/uom/si/area/index.html https://docs.rs/uom/latest/uom/si/area/index.html Am I missing something?
- notamy 3y agoIt has feet, inches, yards, and other less-used(?) units like chains and rods. What units are missing? https://docs.rs/uom/latest/uom/si/length/index.html https://docs.rs/uom/latest/uom/si/length/index.html