From a489eec482c5309b4a397215393d1abb8cc45460 Mon Sep 17 00:00:00 2001 From: Mark Date: Fri, 28 Jul 2023 11:41:25 -0700 Subject: [PATCH] Minor optimization --- src/quantity/quantity.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/quantity/quantity.rs b/src/quantity/quantity.rs index 2080078..d8cd4ab 100644 --- a/src/quantity/quantity.rs +++ b/src/quantity/quantity.rs @@ -124,7 +124,7 @@ impl Quantity { for (uo, _) in other.unit.get_val() { // Use generalized compatible_with check to match reciprocal units // (for example, 1Hz * 1 sec.) - let f = uo.to_base().unit.compatible_with_power(&us.to_base().unit); + let f = Unit::from_free(*uo).compatible_with_power(&Unit::from_free(*us)); if f.is_none() { continue; } let f = f.unwrap();