Artist merge for non-null properties always erases database properties #72
@ -335,11 +335,9 @@ trait Merge {
|
|||||||
fn merge(self, other: Self) -> Self;
|
fn merge(self, other: Self) -> Self;
|
||||||
|
|
||||||
fn merge_opts<T>(this: Option<T>, other: Option<T>) -> Option<T> {
|
fn merge_opts<T>(this: Option<T>, other: Option<T>) -> Option<T> {
|
||||||
match (this, other) {
|
match &this {
|
||||||
(Some(t), Some(_)) => Some(t),
|
Some(_) => this,
|
||||||
(Some(t), None) => Some(t),
|
None => other,
|
||||||
(None, Some(o)) => Some(o),
|
|
||||||
(None, None) => None,
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user