paholg / dimensioned

Compile-time dimensional analysis for various unit systems using Rust's type system.
https://crates.io/crates/dimensioned
MIT License
300 stars 23 forks source link

Feature: Add type aliases for dimensions #74

Closed jsbrucker closed 3 years ago

jsbrucker commented 3 years ago

While I recognize this is somewhat redundant, in that a user could achieve the same thing using the units eg: si::Meter

I suspect in many areas the ability to use terms like Length, Area, and Volume could be beneficial.

https://github.com/paholg/dimensioned/issues/33

jsbrucker commented 3 years ago

How embarrassing that I totally missed the example using Length and Time trait bounds in the README... that is obviously a much more robust solution, though having concrete types available might clean up some of the boilerplate needed with bounds when the implementation doesn't need to be generic across unit systems while still providing a similar feel.

For now I'm going to close my PR, feel free to reopen if you think the functionality is worth adding. I should have paid closer attention.