diff options
| author | Laurenz <laurmaedje@gmail.com> | 2020-08-19 21:12:34 +0200 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2020-08-19 21:12:34 +0200 |
| commit | 141d69cb60d4f565f06ccd4ebeb353e748fadb7f (patch) | |
| tree | f8fe203a6ed2aedc46a8f7e975bd16671476e58b /src/macros.rs | |
| parent | fd9959fd04739c1dab2ea1a899a17c94e0892103 (diff) | |
Remove some obsolete stuff ❌
Diffstat (limited to 'src/macros.rs')
| -rw-r--r-- | src/macros.rs | 18 |
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, |
