mirror of
https://github.com/lennart-k/rustical.git
synced 2025-12-14 08:12:24 +00:00
xml: Strict namespace, some tests and restructuring
This commit is contained in:
@@ -3,15 +3,9 @@ use std::collections::HashMap;
|
||||
use darling::{util::Flag, FromDeriveInput, FromField, FromMeta, FromVariant};
|
||||
use syn::LitByteStr;
|
||||
|
||||
#[derive(Default, FromMeta, Clone)]
|
||||
pub struct ContainerAttrs {
|
||||
pub ns_strict: Flag,
|
||||
}
|
||||
|
||||
#[derive(Default, FromMeta, Clone)]
|
||||
pub struct TagAttrs {
|
||||
pub rename: Option<LitByteStr>,
|
||||
pub ns_strict: Flag,
|
||||
pub ns: Option<syn::Path>,
|
||||
}
|
||||
|
||||
@@ -27,18 +21,12 @@ pub struct VariantAttrs {
|
||||
#[derive(Default, FromDeriveInput, Clone)]
|
||||
#[darling(attributes(xml))]
|
||||
pub struct EnumAttrs {
|
||||
#[darling(flatten)]
|
||||
// TODO: implement ns_strict
|
||||
pub _container: ContainerAttrs,
|
||||
pub untagged: Flag,
|
||||
}
|
||||
|
||||
#[derive(Default, FromDeriveInput, Clone)]
|
||||
#[darling(attributes(xml))]
|
||||
pub struct StructAttrs {
|
||||
#[darling(flatten)]
|
||||
pub container: ContainerAttrs,
|
||||
|
||||
pub root: Option<LitByteStr>,
|
||||
pub ns: Option<syn::Path>,
|
||||
#[darling(default)]
|
||||
|
||||
Reference in New Issue
Block a user