Skip to content

Commit 6b4358f

Browse files
Revert ast change
1 parent 51ce686 commit 6b4358f

File tree

1 file changed

+4
-18
lines changed

1 file changed

+4
-18
lines changed

core/src/num/unit.rs

+4-18
Original file line numberDiff line numberDiff line change
@@ -283,24 +283,10 @@ impl Value {
283283
println!("\t{:?}", rhs);
284284
let mut components = self.unit.components.clone();
285285
for rhs_component in rhs.unit.components {
286-
let mut self_has_unit = false;
287-
for self_component in &self.unit.components {
288-
if compare_hashmaps(
289-
&self_component.unit.base_units,
290-
&rhs_component.unit.base_units,
291-
int,
292-
)? {
293-
self_has_unit = true;
294-
break;
295-
}
296-
}
297-
let new_exponent = if self_has_unit {
298-
-rhs_component.exponent
299-
} else {
300-
rhs_component.exponent
301-
};
302-
println!("\t\t{:?}", new_exponent);
303-
components.push(UnitExponent::new(rhs_component.unit, new_exponent));
286+
components.push(UnitExponent::new(
287+
rhs_component.unit,
288+
-rhs_component.exponent,
289+
));
304290
}
305291
let value =
306292
Exact::new(self.value, self.exact).div(&Exact::new(rhs.value, rhs.exact), int)?;

0 commit comments

Comments
 (0)