Introduce MaybeError type

This commit is contained in:
micialware committed 2026-08-24 23:42:58 +03:00
1 parent d836b57d2a
commit a60ed37cd4
16 files changed
+127 -93

No files matched your search

+10
View File
@@ -10,4 +10,14 @@ macro_rules! push_error {
($e:expr) => {
$crate::navigation::RootMessage::PushNotification($crate::notification::NotificationRequest::Error($e))
}
}
#[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)
}
}