Skip to content

Commit

Permalink
🩹 validate now requires a comma separated argument list
Browse files Browse the repository at this point in the history
lockstep-macro `validate` lacked syntax for multiple arguments.
This commit makes `validate` require a comma separeted list if multiple
arguments are to be provided.
  • Loading branch information
luukvanderduim committed Mar 18, 2024
1 parent f583113 commit 432845e
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion zbus-lockstep-macros/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,14 @@ use syn::{parse::ParseStream, parse_macro_input, Ident, ItemStruct, LitStr, Toke
/// }
/// ```
///
/// ## Multiple arguments
///
/// You can provide multiple arguments with a comma separated list.
///
/// # Examples
///
/// ```ignore
/// #[validate(xml: "xml")]
/// #[validate(xml: "xml", interface: "org.example.Node", signal: "RemoveNode")]
/// #[derive(Type)]
/// struct RemoveNodeSignal {
/// name: String,
Expand Down Expand Up @@ -314,6 +317,10 @@ impl syn::parse::Parse for ValidateArgs {
))
}
}

if !input.is_empty() {
input.parse::<Token![,]>()?;
}
}

Ok(ValidateArgs {
Expand Down

0 comments on commit 432845e

Please sign in to comment.