xso: re-implement #[xml(lang)] on top of #[xml(attribute)]

This gives us all the goodies of `default`, `type_` and `codec` without
having to duplicate lots of code (and I think the `match`-iness of the
new macro code is still within limits).

However, we still keep them as separate `#[xml(..)]` attributes, because
their semantics are very different and it is sensible to make them stand
out.

skip-changelog, because `#[xml(lang)]` was introduced in this version.
This commit is contained in:
Jonas Schäfer 2025-04-27 10:32:17 +02:00
commit 67f3ffaced
6 changed files with 198 additions and 138 deletions

View file

@ -2467,7 +2467,7 @@ struct Language {
#[xml(child(default))]
child: core::option::Option<Box<Language>>,
#[xml(lang)]
#[xml(lang(default))]
lang: core::option::Option<String>,
}