- Fix feature gates on square root / cube root implementation.
- Remove unused code lints in new rust version (@jedbrown)
- Restore no_std (@jedbrown, see #77)
- Use maintained HDF5 fork to allow HDF5 versions of 1.14.x (see #78, #79)
no_std
support (@jedbrown, see #55, #60)- New unit constructors and conversions (@tehforsch, see #73, #56).
-
- New quantities can now be constructed via
unit.new
andval * unit
syntax.
- New quantities can now be constructed via
-
- The
value_in
method replaces all the autogeneratedin_{unit}
conversion methods.
- The
- Overhauled the
unit_system
macro. (see the readme and the SI module insrc/si.rs
for example usage). (See #44) -
- The
Dimension
type does not need to be defined by the user anymore and is derived automatically.
- The
-
- The new syntax is much more explicit about what the base units are and prevents accidentally declaring multiple base units (which could be a critical error).
-
- Similarly, defining units in terms of a dimension is not allowed anymore and units can only be derived from the base units and other derived units.
-
- Support adding prefixes to custom units via the
#[prefix(...)]
attribute to save time and prevent bugs due to typos due to wrong conversion factors.
- Support adding prefixes to custom units via the
-
- Support adding aliases to custom units via the
#[alias(...)]
attribute.
- Support adding aliases to custom units via the
-
- Added a large list of dimensions and units to the SI module, each including all metric prefixes from atto to exa.
- Add support for rational dimensions. This is not enabled by default and requires the
rational-dimensions
feature gate. (See #48) - Add various numeric trait implementations for references of quantities. (See #50 and #53)
- Add various trait implementations for dimensionless quantities and their underlying storage types:
MulAssign
,DivAssign
,PartialEq
,PartialOrd
,From
. For example, this makes it possible to write:
let x: f64 = 1.0;
let l1 = Length::meters(200.0);
let l2 = Length::kilometers(1.0);
let mut ratio = l1 / l2;
if l1 / l2 < x {
ratio += x;
}
- Factors of one can now be used in quantity definitions (see #28):
def InverseTemperature = 1 / Temperature
- Exponents can now be used in quantity definitions(see #32):
def Volume = Length^3
- Added more SI dimensions and units (see #17). (@jedbrown)
- Added an example for conversions between gas equations of state (see #17). (@jedbrown)
- The
unit_system
macro now emits all the definitions it can, even if it is called with unresolvable or invalid definitions. This makes it easier to spot the error in the macro call in large codebases. Previously, hundreds of errors would be emitted due to one wrong definition, because every quantity and unit was now undefined. - Automatically derive
ConstParamTy
for theDimension
type.
- Fixed proc macro panicking in cases with recursive / duplicate definitions of quantities. Instead, a proper error message is emitted that highlights the conflicting quantities. (See #21)
- Fixed a number of cases in which the compiler emitted extremely ugly error messages (see #23).
- Fix dimension expressions being parsed right-associatively (see #30)
- Added a large number of compile_fail tests as a way to ensure emitted error messages remain useful in future diman/compiler versions.
Initial release