summaryrefslogtreecommitdiffstats
path: root/src/macros.rs
diff options
context:
space:
mode:
authorKartikaya Gupta <kgupta@mozilla.com>2016-06-18 15:21:39 +0100
committerKartikaya Gupta <kgupta@mozilla.com>2016-06-18 15:21:39 +0100
commit5dfc306f0ac9296a48363e342a79a14f11cc3707 (patch)
treec26557b8f1eca6ff8ee8361bb9c369b17f1bad7f /src/macros.rs
parent653c5ab82baf400e798513f34779e7a2a0448bb8 (diff)
Make decode_word return an Option instead of an ignored Error
Diffstat (limited to 'src/macros.rs')
-rw-r--r--src/macros.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/macros.rs b/src/macros.rs
new file mode 100644
index 0000000..980f0eb
--- /dev/null
+++ b/src/macros.rs
@@ -0,0 +1,8 @@
+macro_rules! try_none {
+ ( $x:expr ) => {{
+ match $x {
+ Some(v) => v,
+ None => return None,
+ }
+ }}
+}