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, }