summaryrefslogtreecommitdiffstats
path: root/src/utils
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils')
-rw-r--r--src/utils/mod.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/utils/mod.rs b/src/utils/mod.rs
index 0bd1d41..a551855 100644
--- a/src/utils/mod.rs
+++ b/src/utils/mod.rs
@@ -117,6 +117,14 @@ where
}
}
+pub fn convert_option_string(value: &str) -> Option<String> {
+ if value.is_empty() {
+ None
+ } else {
+ Some(value.to_string())
+ }
+}
+
pub fn fuzzy_match(text: &str, pattern: &str) -> bool {
let text_chars: Vec<char> = text.chars().collect();
let pattern_chars: Vec<char> = pattern.chars().collect();