Skip to content

Commit

Permalink
Allow no message and use tt for msg
Browse files Browse the repository at this point in the history
  • Loading branch information
Kuuuube committed Mar 22, 2024
1 parent 2556daa commit 3be77c0
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/macros.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#[macro_export]
macro_rules! unwrap_or_continue {
($res:expr, $msg:literal) => {
($res:expr, $msg:tt) => {
match $res {
Ok(ok) => ok,
Err(err) => {
Expand All @@ -9,4 +9,12 @@ macro_rules! unwrap_or_continue {
}
}
};
($res:expr) => {
match $res {
Ok(ok) => ok,
Err(err) => {
continue;
}
}
};
}

0 comments on commit 3be77c0

Please sign in to comment.