Add clone
This commit is contained in:
parent
2c9d4ed71d
commit
b622fd7993
|
@ -140,10 +140,20 @@ pub fn gen_load(feature: &vkxml::Feature, commands: &CommandMap) -> quote::Token
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.collect();
|
.collect();
|
||||||
|
let names: Vec<_> = commands.iter().map(|cmd| cmd.command_ident()).collect();
|
||||||
|
let names_left = &names;
|
||||||
|
let names_right = &names;
|
||||||
quote!{
|
quote!{
|
||||||
pub struct #ident {
|
pub struct #ident {
|
||||||
#(#function_pointers,)*
|
#(#function_pointers,)*
|
||||||
}
|
}
|
||||||
|
impl ::std::clone::Clone for #ident {
|
||||||
|
pub fn clone(&self) -> Self {
|
||||||
|
#ident{
|
||||||
|
#(#names_left: self.#names_right,)*
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
let version = feature.version_string();
|
let version = feature.version_string();
|
||||||
|
|
Loading…
Reference in a new issue