Skip to content
Myr

Support string interpolation in bail macro

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by David Tolnay · committed by David Tolnay · parent d06569d · Browse files · 1 file+3 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+3 added−0 removed

  • other:+3 added−0 removed

1 file+3 added−0 removed

modified:src/lib.rs+3 added
222 unmodified lines
223macro_rules! bail {224 ($err:expr $(,)?) => {225 return std::result::Result::Err(std::convert::From::from($err));226 };227 ($fmt:expr, $($arg:tt)*) => {228 return std::result::Result::Err($crate::anyhow!($fmt, $($arg)*));229 };230}231232/// Construct an ad-hoc error from a string.233///
35 unmodified lines