From 3002c06dae1ab4a552ffa9a96374efa073e42a9b Mon Sep 17 00:00:00 2001 From: Aaron Hill Date: Mon, 2 Nov 2020 18:36:02 -0500 Subject: [PATCH] Don't emit trailing semicolon from `bail!` This will allow `bail!` to continue to be used in expression position if https://github.com/rust-lang/rust/issues/33953 is fixed --- src/macros.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/macros.rs b/src/macros.rs index c83dfa5..c4b4c80 100644 --- a/src/macros.rs +++ b/src/macros.rs @@ -53,13 +53,13 @@ #[macro_export] macro_rules! bail { ($msg:literal $(,)?) => { - return $crate::private::Err($crate::anyhow!($msg)); + return $crate::private::Err($crate::anyhow!($msg)) }; ($err:expr $(,)?) => { - return $crate::private::Err($crate::anyhow!($err)); + return $crate::private::Err($crate::anyhow!($err)) }; ($fmt:expr, $($arg:tt)*) => { - return $crate::private::Err($crate::anyhow!($fmt, $($arg)*)); + return $crate::private::Err($crate::anyhow!($fmt, $($arg)*)) }; }