aboutsummaryrefslogtreecommitdiff
path: root/src/macros.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/macros.rs')
-rw-r--r--src/macros.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/macros.rs b/src/macros.rs
index eb37d4db..740e5ed9 100644
--- a/src/macros.rs
+++ b/src/macros.rs
@@ -48,3 +48,12 @@ macro_rules! debug_print {
}
}
+#[macro_export]
+macro_rules! maybe {
+ ($option:expr) => {
+ match $option {
+ Some(value) => value,
+ None => return None,
+ }
+ }
+}