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 {
|
match unit {
|
||||||
// Length
|
// Length
|
||||||
NonMetric::Foot => Conversion {
|
|
||||||
from: inch_from,
|
|
||||||
to: MetricQuantity { amount: 12.0 * inch_to, unit: Metric::Metre },
|
|
||||||
},
|
|
||||||
NonMetric::Inch => Conversion {
|
NonMetric::Inch => Conversion {
|
||||||
from: inch_from,
|
from: inch_from,
|
||||||
to: MetricQuantity { amount: inch_to, unit: Metric::Metre },
|
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 {
|
NonMetric::Yard => Conversion {
|
||||||
from: inch_from,
|
from: inch_from,
|
||||||
to: MetricQuantity { amount: 3.0 * 12.0 * inch_to, unit: Metric::Metre },
|
to: MetricQuantity { amount: 3.0 * 12.0 * inch_to, unit: Metric::Metre },
|
||||||
|
|
|
@ -7,10 +7,10 @@ pub enum Metric {
|
||||||
#[derive(Clone, Copy, Debug, PartialEq)]
|
#[derive(Clone, Copy, Debug, PartialEq)]
|
||||||
pub enum NonMetric {
|
pub enum NonMetric {
|
||||||
// Length
|
// Length
|
||||||
Foot,
|
|
||||||
Inch,
|
Inch,
|
||||||
Mile,
|
Foot,
|
||||||
Yard,
|
Yard,
|
||||||
|
Mile,
|
||||||
// Weight
|
// Weight
|
||||||
Ounce,
|
Ounce,
|
||||||
Pound,
|
Pound,
|
||||||
|
|
Loading…
Reference in a new issue