Order units in order of size

This commit is contained in:
Juhani Krekelä 2023-05-14 02:18:27 +03:00
parent 7170ac3240
commit 034ffed997
2 changed files with 6 additions and 6 deletions

View File

@ -21,14 +21,14 @@ fn get_conversion(unit: NonMetric) -> Conversion {
match unit {
// Length
NonMetric::Foot => Conversion {
from: inch_from,
to: MetricQuantity { amount: 12.0 * inch_to, unit: Metric::Metre },
},
NonMetric::Inch => Conversion {
from: inch_from,
to: MetricQuantity { amount: inch_to, unit: Metric::Metre },
},
NonMetric::Foot => Conversion {
from: inch_from,
to: MetricQuantity { amount: 12.0 * inch_to, unit: Metric::Metre },
},
NonMetric::Yard => Conversion {
from: inch_from,
to: MetricQuantity { amount: 3.0 * 12.0 * inch_to, unit: Metric::Metre },

View File

@ -7,10 +7,10 @@ pub enum Metric {
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum NonMetric {
// Length
Foot,
Inch,
Mile,
Foot,
Yard,
Mile,
// Weight
Ounce,
Pound,