Closed ttencate closed 2 years ago
This does not compile:
assert_eq!( (6.0 * KILOWATT_HOUR) / (2.0 * KILOWATT), 3.0 * HOUR);
error[E0277]: cannot divide `Energy` by `Power` --> src/units.rs:108:35 | 108 | (6.0 * KILOWATT_HOUR) / (2.0 * KILOWATT), | ^ no implementation for `Energy / Power` | = help: the trait `Div<Power>` is not implemented for `Energy`
More generally, if a unit U is defined as the quotient N / D, then operators should be defined both for N / D -> U and for N / U ->D, right?
U
N / D
N / D -> U
N / U ->D
Solved in version '0.11.0'.
Works great, thank you for the super speedy response!
This does not compile:
More generally, if a unit
U
is defined as the quotientN / D
, then operators should be defined both forN / D -> U
and forN / U ->D
, right?