From fa4df234fe05c9b88457b0403fd312c55a5803e3 Mon Sep 17 00:00:00 2001 From: "Lan, Jian" Date: Sun, 15 Feb 2026 20:46:23 +0800 Subject: [PATCH] fix: correct generated `where` clause Eliminate syntax error because of wrong predicate separation and comma placement --- patchable-macro/src/context.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/patchable-macro/src/context.rs b/patchable-macro/src/context.rs index 4474e60..3cb5ade 100644 --- a/patchable-macro/src/context.rs +++ b/patchable-macro/src/context.rs @@ -391,11 +391,11 @@ impl<'a> MacroContext<'a> { fn extend_where_clause(&self, bounds: Vec) -> TokenStream2 { match (&self.generics.where_clause, bounds.is_empty()) { (None, true) => quote! {}, - (None, false) => quote! { where #(#bounds),* }, + (None, false) => quote! { where #(#bounds)* }, (Some(where_clause), true) => quote! { #where_clause }, (Some(where_clause), false) => { let sep = (!where_clause.predicates.trailing_punct()).then_some(quote! {,}); - quote! { #where_clause #sep #(#bounds),* } + quote! { #where_clause #sep #(#bounds)* } } } }