Order units in order of size
This commit is contained in:
parent
7170ac3240
commit
034ffed997
2 changed files with 6 additions and 6 deletions
|
@ -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 },
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue