From 1a493a1716d9a8debadb86230b56b6e4cb571136 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juhani=20Krekel=C3=A4?= Date: Mon, 29 May 2023 21:37:56 +0300 Subject: [PATCH] =?UTF-8?q?Fix=20spelling=20Celcius=20=E2=86=92=20Celsius?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/conversions.rs | 6 +++--- src/format.rs | 12 ++++++------ src/units.rs | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/conversions.rs b/src/conversions.rs index 71b7d32..421f5fa 100644 --- a/src/conversions.rs +++ b/src/conversions.rs @@ -62,7 +62,7 @@ fn get_conversion(unit: NonMetric) -> Conversion { NonMetric::Fahrenheit => Conversion { offset: 32.0, from: 9.0, - to: MetricQuantity { amount: 5.0, unit: Metric::Celcius }, + to: MetricQuantity { amount: 5.0, unit: Metric::Celsius }, }, // Area NonMetric::SquareInch => Conversion { @@ -122,14 +122,14 @@ mod test { unit: NonMetric::Fahrenheit, }), MetricQuantity { amount: -40.0, - unit: Metric::Celcius, + unit: Metric::Celsius, }); assert_eq!(convert(NonMetricQuantity { amount: 32.0, unit: NonMetric::Fahrenheit, }), MetricQuantity { amount: 0.0, - unit: Metric::Celcius, + unit: Metric::Celsius, }); } diff --git a/src/format.rs b/src/format.rs index d19f6cb..e4601f6 100644 --- a/src/format.rs +++ b/src/format.rs @@ -83,7 +83,7 @@ fn prefixed_unit(quantity: MetricQuantity) -> PrefixedUnit { return PrefixedUnit(1.0, "g"); } } - Metric::Celcius => PrefixedUnit(1.0, "°C"), + Metric::Celsius => PrefixedUnit(1.0, "°C"), Metric::SquareMetre => { if absolute >= 1000.0 * 1000.0 { return PrefixedUnit(1000.0 * 1000.0, "km²"); @@ -132,7 +132,7 @@ mod test { assert_eq!("1 000 °C", &format(MetricQuantity { amount: 1_000.0, - unit: Metric::Celcius, + unit: Metric::Celsius, })); } @@ -259,18 +259,18 @@ mod test { } #[test] - fn celcius() { + fn celsius() { assert_eq!(PrefixedUnit(1.0, "°C"), prefixed_unit(MetricQuantity { amount: 0.0001, - unit: Metric::Celcius, + unit: Metric::Celsius, })); assert_eq!(PrefixedUnit(1.0, "°C"), prefixed_unit(MetricQuantity { amount: -1.0, - unit: Metric::Celcius, + unit: Metric::Celsius, })); assert_eq!(PrefixedUnit(1.0, "°C"), prefixed_unit(MetricQuantity { amount: 1_000.0, - unit: Metric::Celcius, + unit: Metric::Celsius, })); } diff --git a/src/units.rs b/src/units.rs index 03c573b..cdd41fd 100644 --- a/src/units.rs +++ b/src/units.rs @@ -2,7 +2,7 @@ pub enum Metric { Metre, Gram, - Celcius, + Celsius, SquareMetre, }