mirror of
https://github.com/lennart-k/rustical.git
synced 2025-12-13 14:42:30 +00:00
xml: tiny refactoring
This commit is contained in:
@@ -70,13 +70,12 @@ impl NamedStruct {
|
||||
.ns_prefix
|
||||
.iter()
|
||||
.map(|(ns, prefix)| {
|
||||
let sep = if !prefix.value().is_empty() {
|
||||
b":".to_vec()
|
||||
let attr_name = if prefix.value().is_empty() {
|
||||
"xmlns".to_owned()
|
||||
} else {
|
||||
b"".to_vec()
|
||||
format!("xmlns:{}", prefix.value())
|
||||
};
|
||||
let attr_name = [b"xmlns".as_ref(), &sep, prefix.value().as_bytes()].concat();
|
||||
let a = syn::LitByteStr::new(&attr_name, prefix.span());
|
||||
let a = syn::LitByteStr::new(attr_name.as_bytes(), prefix.span());
|
||||
quote! {
|
||||
bytes_start.push_attribute((#a.as_ref(), #ns.as_ref()));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user