mirror of
https://github.com/tiffany352/rink-rs
synced 2024-09-20 22:21:57 +00:00
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:
parent
f2d6eee72c
commit
953b133262
1 changed files with 5 additions and 0 deletions
|
@ -152,6 +152,11 @@ impl Context {
|
|||
}
|
||||
}
|
||||
}
|
||||
for (unit, alias) in &self.aliases {
|
||||
if name == alias {
|
||||
return Some(Value(1.0, unit.clone()))
|
||||
}
|
||||
}
|
||||
None
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue