Allow the use of aliases in expressions

I found this useful while attempting to arrive at a given unit. I can do
something such as -> energy or -> power and then the conformance errors
will guide me to which terms I need to add to arrive at a solution.
This commit is contained in:
Tiffany Bennett 2016-08-03 13:06:48 -04:00
parent f2d6eee72c
commit 953b133262

View file

@ -152,6 +152,11 @@ impl Context {
}
}
}
for (unit, alias) in &self.aliases {
if name == alias {
return Some(Value(1.0, unit.clone()))
}
}
None
})
}