chore: simplify build_exceptions
@@ -98,15 +98,9 @@ impl ErrorCode {
}
}
-macro_rules! as_item {
- ($i:item) => {
- $i
- };
-}
macro_rules! build_exceptions {
- ($($body:tt($code:expr)),*$(,)*) => {
- as_item! {
+ ($($body:ident($code:expr)),*$(,)*) => {
impl ErrorCode {
$(
pub fn $body(display_text: impl Into<String>) -> ErrorCode {
@@ -120,7 +114,6 @@ macro_rules! build_exceptions {
}
}
}
-}
build_exceptions! {
Ok(0),
