Remove yr and mon (#3262)

* Remove `yr` and `mon`

* Remove usage of mon in test

* Fix test
This commit is contained in:
Mohammed Anas
2021-04-04 18:19:33 +00:00
committed by GitHub
parent 00acf22f5f
commit e5621dea58
6 changed files with 7 additions and 35 deletions

View File

@ -368,8 +368,6 @@ pub enum Unit {
Hour,
Day,
Week,
Month,
Year,
}
#[derive(Debug, Ord, PartialOrd, Eq, PartialEq, Clone, Hash, Deserialize, Serialize)]
@ -558,8 +556,6 @@ impl Unit {
Unit::Hour => "hr",
Unit::Day => "day",
Unit::Week => "wk",
Unit::Month => "mon",
Unit::Year => "yr",
}
}
@ -624,28 +620,6 @@ impl Unit {
* 1000
* 1000,
),
// FIXME: Number of days per month should not always be 30.
Unit::Month => duration(
size.to_bigint().expect("Conversion should never fail.")
* 30
* 24
* 60
* 60
* 1000
* 1000
* 1000,
),
// FIXME: Number of days per year should not be 365.
Unit::Year => duration(
size.to_bigint().expect("Conversion should never fail.")
* 365
* 24
* 60
* 60
* 1000
* 1000
* 1000,
),
}
}
}