master
Avril 4 years ago
parent 908c520b35
commit 3f3d8a3045
Signed by: flanchan
GPG Key ID: 284488987C31F630

@ -42,25 +42,17 @@ impl Unit
} }
#[cfg(not(nightly))] #[cfg(not(nightly))]
fn multiplier(&self) -> u64 { fn multiplier(&self) -> u64 {
use lazy_static::lazy_static; match self {
use std::collections::HashMap; Second => 1000,
Minute => Second.multiplier() * 60,
Hour => Minute.multiplier() * 60,
fn calc_table(&self) -> { Day => Hour.multiplier() * 24,
use Unit::*; Week => Day.multiplier() * 7,
match self { Year => Week.multiplier() * 52,
Second => 1000, Aeon => Year.multiplier() * 1000000,
Minute => Second.multiplier() * 60,
Hour => Minute.multiplier() * 60,
Day => Hour.multiplier() * 24,
Week => Day.multiplier() * 7,
Year => Week.multiplier() * 52,
Aeon => Year.multiplier() * 1000000,
}
} }
*MUL_TABLE.get(&self).unwrap()
} }
} }
/// A time object parsed from the definition file. /// A time object parsed from the definition file.

@ -1,2 +1,3 @@
use super::*; use super::*;
pub mod user;

@ -0,0 +1 @@
//! passwd queries
Loading…
Cancel
Save