From d847576b592d55596b6adb02e9227d54b85f7d5d Mon Sep 17 00:00:00 2001 From: Paul Dicker Date: Fri, 29 Sep 2023 12:21:08 +0200 Subject: [PATCH] Remove duplicate `try_opt` macro --- src/duration.rs | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/src/duration.rs b/src/duration.rs index 1e5eb67512..f4442648be 100644 --- a/src/duration.rs +++ b/src/duration.rs @@ -16,6 +16,8 @@ use core::{fmt, i64}; #[cfg(feature = "std")] use std::error::Error; +use crate::try_opt; + #[cfg(feature = "rkyv")] use rkyv::{Archive, Deserialize, Serialize}; @@ -38,15 +40,6 @@ const SECS_PER_DAY: i64 = 86_400; /// The number of (non-leap) seconds in a week. const SECS_PER_WEEK: i64 = 604_800; -macro_rules! try_opt { - ($e:expr) => { - match $e { - Some(v) => v, - None => return None, - } - }; -} - /// ISO 8601 time duration with nanosecond precision. /// /// This also allows for the negative duration; see individual methods for details.