xso-proc: provide FromXml::xml_name_matcher on derived impls

That way, derived implementations can also make use of the performance
benefits.
This commit is contained in:
Jonas Schäfer 2025-05-01 16:26:32 +02:00 committed by Link Mauve
commit 59af49c691
5 changed files with 166 additions and 3 deletions

View file

@ -71,6 +71,7 @@ fn from_xml_impl(input: Item) -> Result<TokenStream> {
defs,
from_events_body,
builder_ty_ident,
name_matcher,
} = def.make_from_events_builder(&vis, &name_ident, &attrs_ident)?;
#[cfg_attr(not(feature = "minidom"), allow(unused_mut))]
@ -87,6 +88,10 @@ fn from_xml_impl(input: Item) -> Result<TokenStream> {
) -> ::core::result::Result<Self::Builder, ::xso::error::FromEventsError> {
#from_events_body
}
fn xml_name_matcher() -> ::xso::fromxml::XmlNameMatcher<'static> {
#name_matcher
}
}
};