diff --git a/Cargo.lock b/Cargo.lock index e8d07ce..37b53d1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -761,9 +761,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.95" +version = "1.0.96" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02b3e5e68a3a1a02aad3ec490a98007cbc13c37cbe84a3cd7b8e406d76e7f778" +checksum = "beef09f85ae72cea1ef96ba6870c51e6382ebfa4f0e85b643459331f3daa5be0" dependencies = [ "unicode-ident", ] diff --git a/packages/yew-struct-component-macro/src/lib.rs b/packages/yew-struct-component-macro/src/lib.rs index 0032423..4ac4c71 100644 --- a/packages/yew-struct-component-macro/src/lib.rs +++ b/packages/yew-struct-component-macro/src/lib.rs @@ -137,14 +137,14 @@ pub fn derive_struct_component(input: proc_macro::TokenStream) -> proc_macro::To continue; } - if ident.to_string().starts_with("on") { - if let Type::Path(path) = &field.ty { - let first = path.path.segments.first(); - if first.is_some_and(|segment| segment.ident == "Callback") { - listeners.push(ident.clone()); + if ident.to_string().starts_with("on") + && let Type::Path(path) = &field.ty + { + let first = path.path.segments.first(); + if first.is_some_and(|segment| segment.ident == "Callback") { + listeners.push(ident.clone()); - continue; - } + continue; } }