diff options
| author | Fuwn <[email protected]> | 2021-05-23 13:51:20 +0000 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2021-05-23 13:51:20 +0000 |
| commit | 59cd17d4b5b1eff2847a954012eb916db4ef5116 (patch) | |
| tree | 4074d9935949a48c64fdaa8503ae9ddc61e7678e /crates/whirl_common | |
| parent | build(cargo): create a fast builds configuration for cargo (diff) | |
| download | whirl-59cd17d4b5b1eff2847a954012eb916db4ef5116.tar.xz whirl-59cd17d4b5b1eff2847a954012eb916db4ef5116.zip | |
docs(global): add new documentation
Diffstat (limited to 'crates/whirl_common')
| -rw-r--r-- | crates/whirl_common/src/log.rs | 2 | ||||
| -rw-r--r-- | crates/whirl_common/src/sort.rs | 2 | ||||
| -rw-r--r-- | crates/whirl_common/src/system.rs | 1 |
3 files changed, 5 insertions, 0 deletions
diff --git a/crates/whirl_common/src/log.rs b/crates/whirl_common/src/log.rs index 39ceca0..e905bc8 100644 --- a/crates/whirl_common/src/log.rs +++ b/crates/whirl_common/src/log.rs @@ -3,6 +3,8 @@ use whirl_config::Config; +/// Grab the log level configuration key (`whirlsplash.log.level`) from the +/// configuration file and evaluate the proper log level. pub fn calculate_log_level() -> String { let mut level; diff --git a/crates/whirl_common/src/sort.rs b/crates/whirl_common/src/sort.rs index 131fa55..b1b79b2 100644 --- a/crates/whirl_common/src/sort.rs +++ b/crates/whirl_common/src/sort.rs @@ -1,6 +1,8 @@ // Copyleft (ɔ) 2021-2021 The Whirlsplash Collective // SPDX-License-Identifier: GPL-3.0-only +/// Sort a vector by alphabetical order based on the first character of each +/// string. pub fn sort_vec_alphabetically(vec: &mut Vec<&str>) { vec.sort_by(|a, b| a.to_lowercase().cmp(&b.to_lowercase())); } diff --git a/crates/whirl_common/src/system.rs b/crates/whirl_common/src/system.rs index 7a823a0..3b4806b 100644 --- a/crates/whirl_common/src/system.rs +++ b/crates/whirl_common/src/system.rs @@ -16,6 +16,7 @@ fn make_parts(t: usize, steps: &[usize], mut accum: Vec<usize>) -> Vec<usize> { } } +/// Convert a Unix (Epoch) Timestamp to a human-readable format. pub fn seconds_to_hrtime(seconds: usize) -> String { let word = ["week", "day", "hour", "min", "sec"]; |