summaryrefslogtreecommitdiff
path: root/src/macros.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2020-08-19 21:12:34 +0200
committerLaurenz <laurmaedje@gmail.com>2020-08-19 21:12:34 +0200
commit141d69cb60d4f565f06ccd4ebeb353e748fadb7f (patch)
treef8fe203a6ed2aedc46a8f7e975bd16671476e58b /src/macros.rs
parentfd9959fd04739c1dab2ea1a899a17c94e0892103 (diff)
Remove some obsolete stuff ❌
Diffstat (limited to 'src/macros.rs')
-rw-r--r--src/macros.rs18
1 files changed, 1 insertions, 17 deletions
diff --git a/src/macros.rs b/src/macros.rs
index 2236c480..3cccfc67 100644
--- a/src/macros.rs
+++ b/src/macros.rs
@@ -1,21 +1,5 @@
-#![allow(unused)]
-
-/// Unwrap the result if it is `Ok(T)` or evaluate `$or` if it is `Err(_)`.
-/// This fits use cases the `?`-operator does not cover, like:
-/// ```
-/// try_or!(result, continue);
-/// ```
-macro_rules! try_or {
- ($result:expr, $or:expr $(,)?) => {
- match $result {
- Ok(v) => v,
- Err(_) => $or,
- }
- };
-}
-
/// Unwrap the option if it is `Some(T)` or evaluate `$or` if it is `None`.
-macro_rules! try_opt_or {
+macro_rules! try_or {
($option:expr, $or:expr $(,)?) => {
match $option {
Some(v) => v,