improve error handling

This commit is contained in:
steven-omaha
2023-01-10 18:00:02 +01:00
parent 99bdced2a1
commit 122665a088
3 changed files with 28 additions and 8 deletions
+4
View File
@@ -9,3 +9,7 @@ pub(crate) fn get_editor() -> Result<String> {
fn check_vars_in_order(vars: &[&str]) -> Option<String> {
vars.iter().flat_map(|v| var(v).ok()).next()
}
pub(crate) fn get_single_var(variable: &str) -> Option<String> {
var(variable).ok()
}