MCPcopy Create free account
hub / github.com/apache/fory / has_existing_default

Function has_existing_default

rust/fory-derive/src/object/serializer.rs:26–39  ·  view source on GitHub ↗
(ast: &syn::DeriveInput, trait_name: &str)

Source from the content-addressed store, hash-verified

24use syn::Data;
25
26fn has_existing_default(ast: &syn::DeriveInput, trait_name: &str) -> bool {
27 ast.attrs.iter().any(|attr| {
28 attr.path().is_ident("derive") && {
29 let mut has_default = false;
30 let _ = attr.parse_nested_meta(|meta| {
31 if meta.path.is_ident(trait_name) {
32 has_default = true;
33 }
34 Ok(())
35 });
36 has_default
37 }
38 })
39}
40
41pub fn derive_serializer(
42 ast: &syn::DeriveInput,

Callers 2

derive_serializerFunction · 0.85
generate_default_implFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected