Initial upload: GitPulse - Developer Productivity Analyzer CLI tool
Some checks failed
CI / test (push) Has been cancelled
CI / release (push) Has been cancelled

This commit is contained in:
2026-02-04 15:45:48 +00:00
parent 1c8531a00e
commit 14112c10a4

32
src/utils/mod.rs Normal file
View File

@@ -0,0 +1,32 @@
pub mod author;
pub mod formatting;
use std::collections::HashSet;
pub fn normalize_email(email: &str) -> String {
let email = email.to_lowercase();
email.trim().to_string()
}
pub fn normalize_name(name: &str) -> String {
let name = name.trim();
let mut result = String::new();
let mut capitalize = true;
for c in name.chars() {
if c.is_whitespace() {
capitalize = true;
result.push(c);
} else if capitalize {
result.push(c.to_ascii_uppercase());
capitalize = false;
} else {
result.push(c);
}
}
result
}
pub fn get_unique_items<T: std::hash::Hash + Eq>(items: &[T]) -> Vec<&T> {
let seen: HashSet<&T> = items.iter().collect();
seen.into_iter().collect()
}