2026-08-24 18:16:41 +03:00
|
|
|
#[macro_export]
|
|
|
|
|
macro_rules! push_error_task {
|
|
|
|
|
($e:expr) => {
|
|
|
|
|
iced::Task::done(push_error!($e))
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[macro_export]
|
|
|
|
|
macro_rules! push_error {
|
|
|
|
|
($e:expr) => {
|
|
|
|
|
$crate::navigation::RootMessage::PushNotification($crate::notification::NotificationRequest::Error($e))
|
|
|
|
|
}
|
2026-08-24 23:42:58 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[inline(always)]
|
|
|
|
|
pub fn into_result<R, E>(option: Option<R>, error: E) -> Result<R, E>{
|
|
|
|
|
if let Some(r) = option {
|
|
|
|
|
Ok(r)
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
Err(error)
|
|
|
|
|
}
|
2026-08-24 18:16:41 +03:00
|
|
|
}
|