fix(TimeMetrics Struct): parser of time metric from command argument
This commit is contained in:
parent
c76364c8b4
commit
da5edc1aac
|
@ -11,7 +11,7 @@ pub enum TimeMetrics {
|
||||||
impl TimeMetrics {
|
impl TimeMetrics {
|
||||||
pub fn from(metric: impl Into<&'static str>, duration: i64) -> Self {
|
pub fn from(metric: impl Into<&'static str>, duration: i64) -> Self {
|
||||||
match metric.into() {
|
match metric.into() {
|
||||||
"min" | "minutes" | "minute" | "минута" | "минуты" | "минут" | "мин" => {
|
"m" | "min" | "minutes" | "minute" | "минута" | "минуты" | "минут" | "мин" | "м" => {
|
||||||
Self::Minutes(duration)
|
Self::Minutes(duration)
|
||||||
}
|
}
|
||||||
"h" | "hours" | "hour" | "час" | "часов" | "ч" => Self::Hours(duration),
|
"h" | "hours" | "hour" | "час" | "часов" | "ч" => Self::Hours(duration),
|
||||||
|
@ -21,7 +21,7 @@ impl TimeMetrics {
|
||||||
"w" | "weeks" | "week" | "недель" | "недели" | "неделя" | "н" => {
|
"w" | "weeks" | "week" | "недель" | "недели" | "неделя" | "н" => {
|
||||||
Self::Weeks(duration)
|
Self::Weeks(duration)
|
||||||
}
|
}
|
||||||
"m" | "months" | "month" | "месяц" | "месяца" | "месяцев" | "мес" => {
|
"M" | "months" | "month" | "месяц" | "месяца" | "месяцев" | "мес" | "М" => {
|
||||||
Self::Mounths(duration)
|
Self::Mounths(duration)
|
||||||
}
|
}
|
||||||
_ => Self::Days(duration),
|
_ => Self::Days(duration),
|
||||||
|
|
Loading…
Reference in New Issue