Skip to content

Commit

Permalink
Don't emit trailing semicolon from bail!
Browse files Browse the repository at this point in the history
This will allow `bail!` to continue to be used in expression position if
rust-lang/rust#33953 is fixed
  • Loading branch information
Aaron1011 committed Nov 2, 2020
1 parent c25be95 commit 3002c06
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)*))
};
}

Expand Down

0 comments on commit 3002c06

Please sign in to comment.