mirror of
https://github.com/lennart-k/rustical.git
synced 2025-12-14 04:42:15 +00:00
xml: Change ns_prefix from LitByteStr to LitStr
This commit is contained in:
@@ -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,
|
||||
}
|
||||
|
||||
|
||||
@@ -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()));
|
||||
|
||||
Reference in New Issue
Block a user