iliekturtles / uom

Units of measurement -- type-safe zero-cost dimensional analysis
Apache License 2.0
1.03k stars 98 forks source link

Add areal heat capacity quantity #446

Closed yacinelakel closed 10 months ago

yacinelakel commented 1 year ago

Added new quantity ArealHeatCapacity with base unit J/(m²·K).

iliekturtles commented 10 months ago

Sorry for the extended delay! If you could apply the diff below, I will merge. Just a couple formatting fixes.

diff --git a/src/si/areal_heat_capacity.rs b/src/si/areal_heat_capacity.rs
index 329b33f..d63a28f 100644
--- a/src/si/areal_heat_capacity.rs
+++ b/src/si/areal_heat_capacity.rs
@@ -14,8 +14,8 @@ quantity! {
         Z0,     // amount of substance
         Z0>;    // luminous intensity
     units {
-        @joule_per_square_meter_kelvin: prefix!(none); "J/(m² · K)", "joule per square meter kelvin",
-            "joules per square meter kelvin";
+        @joule_per_square_meter_kelvin: prefix!(none); "J/(m² · K)",
+            "joule per square meter kelvin", "joules per square meter kelvin";
     }
 }

@@ -39,11 +39,9 @@ mod tests {
         fn check_heat_capacity_area_units() {
             test::<hc::joule_per_kelvin, a::square_meter, ahc::joule_per_square_meter_kelvin>();

-            fn test<HC: hc::Conversion<V>, A: a::Conversion<V>, AHC: ahc::Conversion<V>>()
-            {
+            fn test<HC: hc::Conversion<V>, A: a::Conversion<V>, AHC: ahc::Conversion<V>>() {
                 Test::assert_approx_eq(&ArealHeatCapacity::new::<AHC>(V::one()),
-                    &(HeatCapacity::new::<HC>(V::one()) / (Area::new::<A>(V::one())))
-                );
+                    &(HeatCapacity::new::<HC>(V::one()) / (Area::new::<A>(V::one()))));
             }
         }
     }
yacinelakel commented 10 months ago

Fixed. 👍

iliekturtles commented 10 months ago

Thanks for your patience. Merged!