aboutsummaryrefslogtreecommitdiff
path: root/crates/whirl_common/src
diff options
context:
space:
mode:
authorFuwn <[email protected]>2021-05-28 00:06:40 -0700
committerFuwn <[email protected]>2021-05-28 00:06:40 -0700
commit179ce3277ece536cae41b834469f4065e3600d82 (patch)
treea96d55a34531c9761f6309c35f8d9cfab9879db6 /crates/whirl_common/src
parentMerge branch 'develop' of https://github.com/Whirlsplash/whirl into develop (diff)
downloadwhirl-179ce3277ece536cae41b834469f4065e3600d82.tar.xz
whirl-179ce3277ece536cae41b834469f4065e3600d82.zip
fix(global): a lot of clippy warnings
This change makes clippy **a lot** more strict.
Diffstat (limited to 'crates/whirl_common/src')
-rw-r--r--crates/whirl_common/src/lib.rs10
-rw-r--r--crates/whirl_common/src/log.rs1
-rw-r--r--crates/whirl_common/src/sort.rs2
-rw-r--r--crates/whirl_common/src/system.rs1
4 files changed, 12 insertions, 2 deletions
diff --git a/crates/whirl_common/src/lib.rs b/crates/whirl_common/src/lib.rs
index 081da1c..82eac48 100644
--- a/crates/whirl_common/src/lib.rs
+++ b/crates/whirl_common/src/lib.rs
@@ -10,7 +10,15 @@
decl_macro,
proc_macro_hygiene
)]
-#![warn(rust_2018_idioms)]
+#![deny(
+ warnings,
+ nonstandard_style,
+ unused,
+ future_incompatible,
+ rust_2018_idioms,
+ unsafe_code
+)]
+#![deny(clippy::all, clippy::nursery, clippy::pedantic)]
#![recursion_limit = "128"]
pub mod log;
diff --git a/crates/whirl_common/src/log.rs b/crates/whirl_common/src/log.rs
index e905bc8..d2df568 100644
--- a/crates/whirl_common/src/log.rs
+++ b/crates/whirl_common/src/log.rs
@@ -5,6 +5,7 @@ use whirl_config::Config;
/// Grab the log level configuration key (`whirlsplash.log.level`) from the
/// configuration file and evaluate the proper log level.
+#[must_use]
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 b1b79b2..7cbabd6 100644
--- a/crates/whirl_common/src/sort.rs
+++ b/crates/whirl_common/src/sort.rs
@@ -3,6 +3,6 @@
/// Sort a vector by alphabetical order based on the first character of each
/// string.
-pub fn sort_vec_alphabetically(vec: &mut Vec<&str>) {
+pub fn 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 3b4806b..2fb79e7 100644
--- a/crates/whirl_common/src/system.rs
+++ b/crates/whirl_common/src/system.rs
@@ -17,6 +17,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 {
let word = ["week", "day", "hour", "min", "sec"];