From 3f1d5257344bbd06f9be1e923f3a9e15660604e6 Mon Sep 17 00:00:00 2001 From: Evan Almloff Date: Sat, 11 Mar 2023 18:27:50 -0600 Subject: [PATCH] make trailing commas in components optional --- packages/rsx/src/component.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/packages/rsx/src/component.rs b/packages/rsx/src/component.rs index 5dc18e0e6..508209adc 100644 --- a/packages/rsx/src/component.rs +++ b/packages/rsx/src/component.rs @@ -243,16 +243,12 @@ impl Parse for ComponentField { let forked = input.fork(); let t: LitStr = forked.parse()?; // the string literal must either be the end of the input or a followed by a comma - if (forked.is_empty() || forked.peek(Token![,])) && is_literal_foramtted(&t) { + if is_literal_foramtted(&t) { let content = ContentField::Formatted(input.parse()?); return Ok(Self { name, content }); } } - if input.peek(LitStr) && input.peek2(LitStr) { - missing_trailing_comma!(input.span()); - } - let content = ContentField::ManExpr(input.parse()?); Ok(Self { name, content }) }