diff options
| author | Fuwn <[email protected]> | 2021-07-03 13:15:37 -0700 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2021-07-03 13:15:37 -0700 |
| commit | 2cbfca84a1df5e639d072ad79239fd64d8c5b477 (patch) | |
| tree | 3c45489b5ff509bce2ba237f6566425ca78447d1 /crates/whirl_common | |
| parent | test(whirl_common): add criterion benchmarks (diff) | |
| download | whirl-2cbfca84a1df5e639d072ad79239fd64d8c5b477.tar.xz whirl-2cbfca84a1df5e639d072ad79239fd64d8c5b477.zip | |
refactor(whirl_common): rename `seconds_to_hrtime` to `unixts_to_hrtime`
Diffstat (limited to 'crates/whirl_common')
| -rw-r--r-- | crates/whirl_common/src/system.rs | 2 | ||||
| -rw-r--r-- | crates/whirl_common/tests/test.rs | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/crates/whirl_common/src/system.rs b/crates/whirl_common/src/system.rs index c4b203c..72f6a33 100644 --- a/crates/whirl_common/src/system.rs +++ b/crates/whirl_common/src/system.rs @@ -18,7 +18,7 @@ fn make_parts(t: usize, steps: &[usize], mut accum: Vec<usize>) -> Vec<usize> { /// Convert a Unix (Epoch) Timestamp to a human-readable format. #[must_use] -pub fn seconds_to_hrtime(seconds: usize) -> String { +pub fn unixts_to_hrtime(seconds: usize) -> String { let word = ["week", "day", "hour", "min", "sec"]; make_parts(seconds, &[WEEK, DAY, HOUR, MIN, 1], Vec::new()) diff --git a/crates/whirl_common/tests/test.rs b/crates/whirl_common/tests/test.rs index 6727948..d786fa4 100644 --- a/crates/whirl_common/tests/test.rs +++ b/crates/whirl_common/tests/test.rs @@ -16,6 +16,6 @@ fn vec_alphabetically() { fn seconds_to_hrtime() { assert_eq!( "125 weeks, 14 days, 9 hours, 37 mins, 57 secs", - whirl_common::system::seconds_to_hrtime(1623058677), + whirl_common::system::unixts_to_hrtime(1623058677), ); } |