Avoid unnecessary allocation
This commit is contained in:
parent
1d9081b07a
commit
df244e89b6
|
@ -39,9 +39,9 @@ pub fn to_xml(input: TokenStream) -> TokenStream {
|
||||||
|
|
||||||
let ident = &ast.ident;
|
let ident = &ast.ident;
|
||||||
let root_name = ident.to_string();
|
let root_name = ident.to_string();
|
||||||
let mut header: String = root_name.to_string();
|
let header = match retrieve_default_namespace(&ast) {
|
||||||
if let Some(v) = retrieve_default_namespace(&ast) {
|
Some(ns) => format!("{} xmlns=\"{}\"", root_name, ns),
|
||||||
header += format!(" xmlns=\"{}\"", v).as_str();
|
None => root_name.clone(),
|
||||||
};
|
};
|
||||||
|
|
||||||
let mut output: proc_macro2::TokenStream =
|
let mut output: proc_macro2::TokenStream =
|
||||||
|
|
Loading…
Reference in New Issue