first steps: input alias implementation

This commit is contained in:
euzu
2025-02-14 17:51:33 +01:00
parent 4460991bb8
commit 180cff75dc
7 changed files with 100 additions and 40 deletions
+10
View File
@@ -30,4 +30,14 @@ impl Capitalize for String {
fn capitalize(&self) -> String {
self.as_str().capitalize() // Reuse the &str implementation
}
}
pub fn get_trimmed_string(value: &Option<String>) -> Option<String> {
if let Some(v) = value {
let trimmed = v.trim();
if !trimmed.is_empty() {
return Some(trimmed.to_string());
}
}
None
}