Adapt blocks to include markers
This commit is contained in:
parent
26e988114c
commit
21d908874d
4 changed files with 112 additions and 99 deletions
15
src/macros.rs
Normal file
15
src/macros.rs
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
macro_rules! some_or_return {
|
||||
($e:expr) => {
|
||||
match $e {
|
||||
None => return,
|
||||
Some(result) => result,
|
||||
}
|
||||
};
|
||||
($e:expr, $ret:expr) => {
|
||||
match $e {
|
||||
None => return $ret,
|
||||
Some(result) => result,
|
||||
}
|
||||
};
|
||||
}
|
||||
pub(crate) use some_or_return;
|
||||
Loading…
Add table
Add a link
Reference in a new issue