1#[macro_export]
2macro_rules! throw {
3 ($msg:literal $(,)?) => { {
4 ::ez::__::Err(::ez::Error::msg($msg))?;
5 unreachable!()
6 } };
7
8 ($msg:literal $(, $rest:tt)* $(,)?) => { {
9 ::ez::__::Err(::ez::Error::msg(format!($msg $(, $rest)*)))?;
10 unreachable!()
11 } };
12
13 ($error:expr $(,)?) => { {
14 ::ez::__::Err($error)?;
15 unreachable!()
16 } };
17
18 ($(,)?) => { {
19 ::ez::__::Err(::ez::__::core::default::Default::default())?;
20 unreachable!()
21 } };
22}
23
24#[macro_export]
25macro_rules! publish {
26 {
27 pub use $path:path $(as $name:ident)?;
28 $(prose from $doc:literal;)*
29 $(example $example:ident;)*
30 $(failing example $failing:ident;)*
31 } => {
32 $(
33 #[doc = include_str!(concat!("./", $doc))]
35 )*
37 $(
38 #[doc = concat!("## Example `", stringify!($example), "`")]
40 #[doc = include_str!(concat!("../examples/", stringify!($example), ".rs"))]
44 )*
46 $(
47 #[doc = concat!("## Example `", stringify!($failing), "`")]
49 #[doc = include_str!(concat!("../examples/", stringify!($failing), ".rs"))]
53 )*
55 #[doc(inline)]
57 pub use $path $(as $name)?;
58 }
59}