Fix lib unit tests
This commit is contained in:
parent
5abac79414
commit
dd9141352c
@ -48,8 +48,15 @@ pub enum MbRefOption<T> {
|
|||||||
impl<T> MbRefOption<T> {
|
impl<T> MbRefOption<T> {
|
||||||
pub fn or(self, optb: MbRefOption<T>) -> MbRefOption<T> {
|
pub fn or(self, optb: MbRefOption<T>) -> MbRefOption<T> {
|
||||||
match self {
|
match self {
|
||||||
x @ MbRefOption::Some(_) => x,
|
opta @ MbRefOption::Some(_) => opta,
|
||||||
MbRefOption::CannotHaveMbid | MbRefOption::None => optb,
|
opta @ MbRefOption::CannotHaveMbid => {
|
||||||
|
if matches!(optb, MbRefOption::Some(_)) {
|
||||||
|
optb
|
||||||
|
} else {
|
||||||
|
opta
|
||||||
|
}
|
||||||
|
}
|
||||||
|
MbRefOption::None => optb,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user