Skip to content

Commit db72337

Browse files
xsd-parser: Add clone to struct
Signed-off-by: Patrick José Pereira <patrickelectric@gmail.com>
1 parent 209f64c commit db72337

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

xsd-parser/src/generator/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ mod test {
9292
..Default::default()
9393
}));
9494
let comment = "// comment\n";
95-
let macros = "#[derive(Default, PartialEq, Debug, UtilsTupleIo, UtilsDefaultSerde)]\n";
95+
let macros = "#[derive(Default, Clone, PartialEq, Debug, UtilsTupleIo, UtilsDefaultSerde)]\n";
9696
let validation = "impl Validate for Name {}\n";
9797
let expected =
9898
format!("{}{}pub struct Name (pub Type);\n\n{}", comment, macros, validation);

xsd-parser/src/generator/struct.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ pub trait StructGenerator {
7979
}
8080

8181
fn macros(&self, _entity: &Struct, gen: &Generator) -> Cow<'static, str> {
82-
let derives = "#[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)]\n";
82+
let derives = "#[derive(Default, Clone, PartialEq, Debug, YaSerialize, YaDeserialize)]\n";
8383
let tns = gen.target_ns.borrow();
8484
match tns.as_ref() {
8585
Some(tn) => match tn.name() {

xsd-parser/src/generator/tuple_struct.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ pub trait TupleStructGenerator {
3939
}
4040

4141
fn macros(&self, _entity: &TupleStruct, _gen: &Generator) -> Cow<'static, str> {
42-
"#[derive(Default, PartialEq, Debug, UtilsTupleIo, UtilsDefaultSerde)]\n".into()
42+
"#[derive(Default, Clone, PartialEq, Debug, UtilsTupleIo, UtilsDefaultSerde)]\n".into()
4343
}
4444

4545
fn format_comment(&self, entity: &TupleStruct, gen: &Generator) -> String {

0 commit comments

Comments
 (0)