[common/exception] refactor: allow suffix comma a the repetition macro definition
@@ -84,7 +84,7 @@ macro_rules! as_item {
}
macro_rules! build_exceptions {
- ($($body:tt($code:expr)),*) => {
+ ($($body:tt($code:expr)),*$(,)*) => {
as_item! {
impl ErrorCode {
$(
@@ -150,14 +150,14 @@ build_exceptions! {
CannotListenerPort(45),
UnknownException(1000),
- TokioError(1001)
+ TokioError(1001),
}
// Store errors
build_exceptions! {
FileMetaNotFound(2001),
- FileDamaged(2002)
+ FileDamaged(2002),
}
pub type Result<T> = std::result::Result<T, ErrorCode>;
