Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 2 additions & 8 deletions src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,7 @@ pub fn select_option_by_clone<T>(a: &Option<T>, b: &Option<T>) -> Option<T>
where
T: Clone,
{
match a {
Some(_a) => Some(_a.clone()),
None => b.clone(),
}
a.as_ref().cloned().or_else(|| b.clone())
}

pub fn option_owned_by_clone<T>(a: Option<&T>) -> Option<T>
Expand All @@ -33,10 +30,7 @@ where
}

pub fn merge_option<T>(a: Option<T>, b: Option<T>) -> Option<T> {
match a {
Some(v) => Some(v),
None => b,
}
a.or(b)
}

pub fn get_bool_from_string(s: &Option<String>, default: bool) -> bool {
Expand Down
Loading