Initialize Twilight project, set up basic framework, initialize DB module

This commit is contained in:
2025-08-07 04:32:34 -03:00
parent 00d61545eb
commit 24d2344f37
29 changed files with 4095 additions and 0 deletions
+22
View File
@@ -0,0 +1,22 @@
pub trait ToTitleCase {
fn to_title_case(&self) -> String;
}
impl<T> ToTitleCase for T
where
T: ToString,
{
fn to_title_case(&self) -> String {
self.to_string()
.split_whitespace()
.map(|word| {
let mut chars = word.chars();
match chars.next() {
Some(first) => first.to_uppercase().collect::<String>() + chars.as_str(),
None => String::new(),
}
})
.collect::<Vec<_>>()
.join(" ")
}
}