mirror of
https://github.com/euzu/tuliprox.git
synced 2026-10-02 22:12:18 +02:00
first steps: input alias implementation
This commit is contained in:
@@ -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
|
||||
}
|
||||
Reference in New Issue
Block a user