From 039e751dd1bb088d95aa968c3b82aeac8d7d7ed6 Mon Sep 17 00:00:00 2001 From: Leo dev Date: Sun, 1 Feb 2026 11:01:20 +0100 Subject: [PATCH] Removed dupes of deps in {} --- macros/src/parse.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/macros/src/parse.rs b/macros/src/parse.rs index 0bb9f23..2cfc37c 100644 --- a/macros/src/parse.rs +++ b/macros/src/parse.rs @@ -2,6 +2,8 @@ //! //! Parses RSX syntax into an AST that can be emitted as Rust code. +use std::collections::HashSet; + use proc_macro2::Span; use syn::braced; use syn::parse::discouraged::Speculative; @@ -269,9 +271,9 @@ fn parse_children(input: ParseStream) -> Result> { Ok(nodes) } -fn extract_vars_from_lit(lit: &LitStr) -> Vec { +fn extract_vars_from_lit(lit: &LitStr) -> HashSet { let s = lit.value(); - let mut vars = Vec::new(); + let mut vars = HashSet::new(); let mut chars = s.chars().peekable(); while let Some(c) = chars.next() { @@ -292,7 +294,7 @@ fn extract_vars_from_lit(lit: &LitStr) -> Vec { } if !name.is_empty() { - vars.push(Ident::new( + vars.insert(Ident::new( &name.split_once(':').unwrap_or((&name, &name)).0, Span::call_site(), ));