Integrate browse API into TUI MB daemon #230
@ -47,13 +47,9 @@ pub enum MbRefOption<T> {
|
||||
|
||||
impl<T> MbRefOption<T> {
|
||||
pub fn or(self, optb: MbRefOption<T>) -> MbRefOption<T> {
|
||||
match self {
|
||||
opta @ MbRefOption::Some(_) => opta,
|
||||
opta @ MbRefOption::CannotHaveMbid => match optb {
|
||||
MbRefOption::Some(_) => optb,
|
||||
MbRefOption::CannotHaveMbid | MbRefOption::None => opta,
|
||||
},
|
||||
MbRefOption::None => optb,
|
||||
match (&self, &optb) {
|
||||
(MbRefOption::Some(_), _) | (MbRefOption::CannotHaveMbid, MbRefOption::None) => self,
|
||||
_ => optb,
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user