xml: Change ns_prefix from LitByteStr to LitStr

This commit is contained in:
Lennart K
2025-08-28 15:19:27 +02:00
parent c38fbe004f
commit 43b4150e28
5 changed files with 20 additions and 20 deletions

View File

@@ -1,7 +1,7 @@
use std::collections::HashMap;
use darling::{FromDeriveInput, FromField, FromMeta, FromVariant, util::Flag};
use syn::{Ident, LitByteStr};
use syn::{Ident, LitByteStr, LitStr};
#[derive(Debug, Default, FromMeta, Clone)]
pub struct TagAttrs {
@@ -33,7 +33,7 @@ pub struct StructAttrs {
pub root: Option<LitByteStr>,
pub ns: Option<syn::Path>,
#[darling(default)]
pub ns_prefix: HashMap<syn::Path, LitByteStr>,
pub ns_prefix: HashMap<syn::Path, LitStr>,
pub allow_invalid: Flag,
}

View File

@@ -75,7 +75,7 @@ impl NamedStruct {
} else {
b"".to_vec()
};
let attr_name = [b"xmlns".as_ref(), &sep, &prefix.value()].concat();
let attr_name = [b"xmlns".as_ref(), &sep, prefix.value().as_bytes()].concat();
let a = syn::LitByteStr::new(&attr_name, prefix.span());
quote! {
bytes_start.push_attribute((#a.as_ref(), #ns.as_ref()));