mirror of
https://github.com/n08i40k/schedule-parser-rusted.git
synced 2025-12-06 17:57:47 +03:00
refactor(parser): rewrite some parts of code
This commit is contained in:
25
schedule-parser/src/macros.rs
Normal file
25
schedule-parser/src/macros.rs
Normal file
@@ -0,0 +1,25 @@
|
||||
#[macro_export]
|
||||
macro_rules! or_continue {
|
||||
( $e:expr ) => {
|
||||
{
|
||||
if let Some(x) = $e {
|
||||
x
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[macro_export]
|
||||
macro_rules! or_break {
|
||||
( $e:expr ) => {
|
||||
{
|
||||
if let Some(x) = $e {
|
||||
x
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user