fn merge_options<T>(o1: Option<T>, o2: Option<T>) -> Option<T> {
  match (o1, o2) {
    (None, Some(v2)) => Some(v2),
    (None, None) => None,
    (Some(v1), _) => Some(v1),
  }
}
/// Merge o2 into o1, only if o2 is missing a value for a particular key
Merge o2 into o1, only if o2 is missing a value for a particular key
Merge o2 into o1 only if o2 is missing a value for a particular key
fn merge_options<T>(o1: Option<T>, o2: Option<T>) -> Option<T> {
  match (o1, o2) {
    (None, Some(v2)) => Some(v2),
    (None, None) => None,
    (Some(v1), _) => Some(v1),
  }
}
fn merge_options < T > ( o1 : Option < T > , o2 : Option < T > ) -> Option < T > { match ( o1 , o2 ) { ( None , Some ( v2 ) ) => Some ( v2 ) , ( None , None ) => None , ( Some ( v1 ) , _ ) => Some ( v1 ) , } }
Merge o2 into o1, only if o2 is missing a value for a particular key
Merge o2 into o1 only if o2 is missing a value for a particular key
o1
Option<T>
o2
Option<T>
o1
Option<T>
o2
Option<T>