Fix empty for loop, if statements and children (#2275)

* fix empty for loop, if statements and children

* fix clippy
This commit is contained in:
Evan Almloff authored and GitHub committed 2024-04-08 19:23:55 -07:00
1 parent 40b576894f
commit af524d979b
8 files changed
+27 -29

No files matched your search

+5 -8
View File
@@ -11,18 +11,15 @@
//! - [ ] Keys
//! - [ ] Properties spreading with with `..` syntax
use self::{location::CallerLocation, renderer::TemplateRenderer};
use self::location::CallerLocation;
use super::*;
use proc_macro2::TokenStream as TokenStream2;
use quote::{quote, ToTokens, TokenStreamExt};
use quote::quote;
use syn::{
ext::IdentExt,
parse::{Parse, ParseBuffer, ParseStream},
spanned::Spanned,
token::Brace,
AngleBracketedGenericArguments, Error, Expr, Ident, LitStr, PathArguments, Result, Token,
ext::IdentExt, parse::ParseBuffer, spanned::Spanned, token::Brace,
AngleBracketedGenericArguments, Error, Expr, Ident, LitStr, PathArguments, Token,
};
#[derive(PartialEq, Eq, Clone, Debug, Hash)]
@@ -184,7 +181,7 @@ impl Component {
}
if !self.children.is_empty() {
let renderer = TemplateRenderer::as_tokens(&self.children, None);
toks.append_all(quote! { .children( Some({ #renderer }) ) });
toks.append_all(quote! { .children( { #renderer } ) });
}
toks.append_all(quote! { .build() });
toks