diff --git a/Cargo.toml b/Cargo.toml index 150ffba..3644a79 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,7 +4,7 @@ edition = "2021" license = "MIT" name = "pg_task" repository = "https://github.com/imbolc/pg_task" -version = "0.1.1" +version = "0.1.2" [dependencies] async-trait = "0.1" diff --git a/examples/counter.rs b/examples/counter.rs index 6ec80e6..c8431c3 100644 --- a/examples/counter.rs +++ b/examples/counter.rs @@ -11,7 +11,7 @@ mod util; pg_task::task!(Count { Start, Proceed, - Finish + Finish, }); // Also we need a enum representing all the possible tasks diff --git a/src/macros.rs b/src/macros.rs index 5140237..1e68cc7 100644 --- a/src/macros.rs +++ b/src/macros.rs @@ -1,7 +1,7 @@ /// Implements enum wrapper for a single task containing all it's steps #[macro_export] macro_rules! task { - ($enum:ident { $($variant:ident),* }) => { + ($enum:ident { $($variant:ident),* $(,)? }) => { #[derive(Debug, serde::Deserialize, serde::Serialize)] pub enum $enum { $($variant($variant),)* @@ -47,7 +47,7 @@ macro_rules! task { /// The macro implements the outer enum wrapper containing all the tasks #[macro_export] macro_rules! scheduler { - ($enum:ident { $($variant:ident),* }) => { + ($enum:ident { $($variant:ident),* $(,)? }) => { $crate::task!($enum { $($variant),* }); impl $crate::Scheduler for $enum {} }