Skip to content

Commit d476e85

Browse files
Merge pull request #167 from patrickelectric/clone
Add clone do types and generated code
2 parents 03328f5 + 075f6b0 commit d476e85

File tree

40 files changed

+70
-69
lines changed

40 files changed

+70
-69
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ There are cases when schema allows extensions for the certain type.
9797
In such cases we don't know in advance what fields must be present in Rust struct so we don't add them to output:
9898

9999
```rust
100-
#[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)]
100+
#[derive(Default, Clone, PartialEq, Debug, YaSerialize, YaDeserialize)]
101101
#[yaserde(prefix = "tns", namespace = "tns: http://example.com")]
102102
pub struct MyType {
103103
#[yaserde(prefix = "tns", rename = "Parameters")]

wsdl-parser/tests/port_type_to_function/expected.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
#[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)]
2+
#[derive(Default, Clone, PartialEq, Debug, YaSerialize, YaDeserialize)]
33
#[yaserde(prefix = "tds", namespace = "tds: http://www.onvif.org/ver10/device/wsdl")]
44
pub struct GetServices {
55
// Indicates if the service capabilities (untyped) should be included in the
@@ -11,7 +11,7 @@ pub struct GetServices {
1111
impl Validate for GetServices {}
1212

1313

14-
#[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)]
14+
#[derive(Default, Clone, PartialEq, Debug, YaSerialize, YaDeserialize)]
1515
#[yaserde(prefix = "tds", namespace = "tds: http://www.onvif.org/ver10/device/wsdl")]
1616
pub struct GetServicesResponse {
1717
// Each Service element contains information about one service.

xsd-parser/src/generator/enum.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ pub trait EnumGenerator {
6565
return "#[derive(PartialEq, Debug, UtilsUnionSerDe)]".into();
6666
}
6767

68-
let derives = "#[derive(PartialEq, Debug, YaSerialize, YaDeserialize)]";
68+
let derives = "#[derive(PartialEq, Debug, Clone, YaSerialize, YaDeserialize)]";
6969
let tns = gen.target_ns.borrow();
7070
match tns.as_ref() {
7171
Some(tn) => match tn.name() {

xsd-parser/src/generator/mod.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,8 @@ mod test {
9292
..Default::default()
9393
}));
9494
let comment = "// comment\n";
95-
let macros = "#[derive(Default, PartialEq, Debug, UtilsTupleIo, UtilsDefaultSerde)]\n";
95+
let macros =
96+
"#[derive(Default, Clone, PartialEq, Debug, UtilsTupleIo, UtilsDefaultSerde)]\n";
9697
let validation = "impl Validate for Name {}\n";
9798
let expected =
9899
format!("{}{}pub struct Name (pub Type);\n\n{}", comment, macros, validation);

xsd-parser/src/generator/struct.rs

+1-1
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

+1-1
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 {

xsd-parser/tests/all/expected.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)]
1+
#[derive(Default, Clone, PartialEq, Debug, YaSerialize, YaDeserialize)]
22
#[yaserde(prefix = "tns", namespace = "tns: http://example.com")]
33
pub struct FooType {
44
#[yaserde(prefix = "tns", rename = "Once")]

xsd-parser/tests/any/expected.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)]
1+
#[derive(Default, Clone, PartialEq, Debug, YaSerialize, YaDeserialize)]
22
#[yaserde(prefix = "tns", namespace = "tns: http://example.com")]
33
pub struct FooType {
44
#[yaserde(prefix = "tns", rename = "Name")]

xsd-parser/tests/choice/expected.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
#[derive(Default, PartialEq, Debug, UtilsTupleIo, UtilsDefaultSerde)]
1+
#[derive(Default, Clone, PartialEq, Debug, UtilsTupleIo, UtilsDefaultSerde)]
22
pub struct BarType(pub String);
33

4-
#[derive(Default, PartialEq, Debug, UtilsTupleIo, UtilsDefaultSerde)]
4+
#[derive(Default, Clone, PartialEq, Debug, UtilsTupleIo, UtilsDefaultSerde)]
55
pub struct BazType(pub i32);
66

7-
#[derive(PartialEq, Debug, YaSerialize, YaDeserialize)]
7+
#[derive(PartialEq, Debug, Clone, YaSerialize, YaDeserialize)]
88
#[yaserde(prefix = "tns", namespace = "tns: http://example.com")]
99
pub enum FooTypeChoice {
1010
Bar(BarType),
@@ -18,7 +18,7 @@ impl Default for FooTypeChoice {
1818
}
1919
}
2020

21-
#[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)]
21+
#[derive(Default, Clone, PartialEq, Debug, YaSerialize, YaDeserialize)]
2222
#[yaserde(prefix = "tns", namespace = "tns: http://example.com")]
2323
pub struct FooType {
2424
#[yaserde(flatten)]

xsd-parser/tests/complex_type/expected.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)]
1+
#[derive(Default, Clone, PartialEq, Debug, YaSerialize, YaDeserialize)]
22
#[yaserde(prefix = "tns", namespace = "tns: http://example.com")]
33
pub struct FooType {
44
#[yaserde(prefix = "tns", rename = "Min")]

xsd-parser/tests/complex_type_subtypes_clash/expected.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)]
1+
#[derive(Default, Clone, PartialEq, Debug, YaSerialize, YaDeserialize)]
22
#[yaserde(prefix = "tns", namespace = "tns: http://example.com")]
33
pub struct FooType {
44
#[yaserde(prefix = "tns", rename = "Extension")]
@@ -10,14 +10,14 @@ impl Validate for FooType {}
1010
pub mod foo_type {
1111
use super::*;
1212

13-
#[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)]
13+
#[derive(Default, Clone, PartialEq, Debug, YaSerialize, YaDeserialize)]
1414
#[yaserde(prefix = "tns", namespace = "tns: http://example.com")]
1515
pub struct ExtensionType {}
1616

1717
impl Validate for ExtensionType {}
1818
}
1919

20-
#[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)]
20+
#[derive(Default, Clone, PartialEq, Debug, YaSerialize, YaDeserialize)]
2121
#[yaserde(prefix = "tns", namespace = "tns: http://example.com")]
2222
pub struct BarType {
2323
#[yaserde(prefix = "tns", rename = "Extension")]
@@ -29,7 +29,7 @@ impl Validate for BarType {}
2929
pub mod bar_type {
3030
use super::*;
3131

32-
#[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)]
32+
#[derive(Default, Clone, PartialEq, Debug, YaSerialize, YaDeserialize)]
3333
#[yaserde(prefix = "tns", namespace = "tns: http://example.com")]
3434
pub struct ExtensionType {}
3535

xsd-parser/tests/enumeration/expected.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#[derive(PartialEq, Debug, YaSerialize, YaDeserialize)]
1+
#[derive(PartialEq, Debug, Clone, YaSerialize, YaDeserialize)]
22
#[yaserde(prefix = "tns", namespace = "tns: http://example.com")]
33
pub enum FooType {
44
#[yaserde(rename = "OFF")]
@@ -18,7 +18,7 @@ impl Default for FooType {
1818
impl Validate for FooType {}
1919

2020

21-
#[derive(Default, PartialEq, Debug, UtilsTupleIo, UtilsDefaultSerde)]
21+
#[derive(Default, Clone, PartialEq, Debug, UtilsTupleIo, UtilsDefaultSerde)]
2222
pub struct FooType2(pub String);
2323

2424
impl Validate for FooType2 {}

xsd-parser/tests/extension_base/expected.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)]
1+
#[derive(Default, Clone, PartialEq, Debug, YaSerialize, YaDeserialize)]
22
#[yaserde(prefix = "tns", namespace = "tns: http://example.com")]
33
pub struct BarType {
44
#[yaserde(prefix = "tns", rename = "b")]
@@ -10,7 +10,7 @@ pub struct BarType {
1010

1111
impl Validate for BarType {}
1212

13-
#[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)]
13+
#[derive(Default, Clone, PartialEq, Debug, YaSerialize, YaDeserialize)]
1414
#[yaserde(prefix = "tns", namespace = "tns: http://example.com")]
1515
pub struct FooType {
1616
#[yaserde(prefix = "tns", rename = "a")]

xsd-parser/tests/extension_base_multilayer/expected.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)]
1+
#[derive(Default, Clone, PartialEq, Debug, YaSerialize, YaDeserialize)]
22
#[yaserde(prefix = "tns", namespace = "tns: http://example.com")]
33
pub struct BarType {
44
#[yaserde(prefix = "tns", rename = "aa")]
@@ -10,7 +10,7 @@ pub struct BarType {
1010

1111
impl Validate for BarType {}
1212

13-
#[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)]
13+
#[derive(Default, Clone, PartialEq, Debug, YaSerialize, YaDeserialize)]
1414
#[yaserde(prefix = "tns", namespace = "tns: http://example.com")]
1515
pub struct FooType {
1616
#[yaserde(prefix = "tns", rename = "Messages")]
@@ -22,7 +22,7 @@ impl Validate for FooType {}
2222
pub mod foo_type {
2323
use super::*;
2424

25-
#[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)]
25+
#[derive(Default, Clone, PartialEq, Debug, YaSerialize, YaDeserialize)]
2626
#[yaserde(prefix = "tns", namespace = "tns: http://example.com")]
2727
pub struct MessagesType {
2828
#[yaserde(prefix = "tns", rename = "a")]

xsd-parser/tests/extension_base_two_files/expected.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)]
1+
#[derive(Default, Clone, PartialEq, Debug, YaSerialize, YaDeserialize)]
22
#[yaserde(
33
prefix = "tns",
44
namespace = "tns: http://example.com",

xsd-parser/tests/ref_to_attribute/expected.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
#[derive(Default, PartialEq, Debug, UtilsTupleIo, UtilsDefaultSerde)]
1+
#[derive(Default, Clone, PartialEq, Debug, UtilsTupleIo, UtilsDefaultSerde)]
22
pub struct Id(pub String);
33

44
impl Validate for Id {}
5-
#[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)]
5+
#[derive(Default, Clone, PartialEq, Debug, YaSerialize, YaDeserialize)]
66
#[yaserde(prefix = "tns", namespace = "tns: http://example.com")]
77
pub struct FooType {
88
#[yaserde(attribute, prefix = "tns", rename = "id")]

xsd-parser/tests/rename_only_where_needed/expected.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)]
1+
#[derive(Default, Clone, PartialEq, Debug, YaSerialize, YaDeserialize)]
22
#[yaserde(prefix = "tns", namespace = "tns: http://example.com")]
33
pub struct FooType {
44
#[yaserde(prefix = "tns")]

xsd-parser/tests/restriction_any_type/expected.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// pub type AppSequence = AppSequenceType;
2-
#[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)]
2+
#[derive(Default, Clone, PartialEq, Debug, YaSerialize, YaDeserialize)]
33
#[yaserde(prefix = "tns", namespace = "tns: http://schemas.xmlsoap.org/ws/2005/04/discovery")]
44
pub struct AppSequenceType {
55
#[yaserde(attribute, rename = "InstanceId")]
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
#[derive(Default, PartialEq, Debug, UtilsTupleIo, UtilsDefaultSerde)]
1+
#[derive(Default, Clone, PartialEq, Debug, UtilsTupleIo, UtilsDefaultSerde)]
22
pub struct FooType (pub String);
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
#[derive(Default, PartialEq, Debug, UtilsTupleIo, UtilsDefaultSerde)]
1+
#[derive(Default, Clone, PartialEq, Debug, UtilsTupleIo, UtilsDefaultSerde)]
22
pub struct FooType (pub Integer);
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
#[derive(Default, PartialEq, Debug, UtilsTupleIo, UtilsDefaultSerde)]
1+
#[derive(Default, Clone, PartialEq, Debug, UtilsTupleIo, UtilsDefaultSerde)]
22
pub struct FooType(pub String);
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
#[derive(Default, PartialEq, Debug, UtilsTupleIo, UtilsDefaultSerde)]
1+
#[derive(Default, Clone, PartialEq, Debug, UtilsTupleIo, UtilsDefaultSerde)]
22
pub struct FooType(pub Vec<i32>);

xsd-parser/tests/type_name_clash/expected.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)]
1+
#[derive(Default, Clone, PartialEq, Debug, YaSerialize, YaDeserialize)]
22
#[yaserde(prefix = "tns", namespace = "tns: http://example.com")]
33
pub struct BarType {
44
#[yaserde(attribute, rename = "a")]
@@ -8,7 +8,7 @@ pub struct BarType {
88
impl Validate for BarType {}
99

1010

11-
#[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)]
11+
#[derive(Default, Clone, PartialEq, Debug, YaSerialize, YaDeserialize)]
1212
#[yaserde(prefix = "tns", namespace = "tns: http://example.com")]
1313
pub struct FooType {
1414
#[yaserde(prefix = "tns", rename = "Bar")]
@@ -20,7 +20,7 @@ impl Validate for FooType {}
2020
pub mod foo_type {
2121
use super::*;
2222

23-
#[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)]
23+
#[derive(Default, Clone, PartialEq, Debug, YaSerialize, YaDeserialize)]
2424
#[yaserde(prefix = "tns", namespace = "tns: http://example.com")]
2525
pub struct BarType {
2626
#[yaserde(attribute, rename = "b")]

xsd-parser/tests/xsd_string/expected.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)]
1+
#[derive(Default, Clone, PartialEq, Debug, YaSerialize, YaDeserialize)]
22
#[yaserde(prefix = "tns", namespace = "tns: http://example.com")]
33
pub struct FooType {
44
#[yaserde(prefix = "tns", rename = "Text")]

xsd-types/src/types/date.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use xsd_macro_utils::UtilsDefaultSerde;
55

66
use crate::types::utils::parse_timezone;
77

8-
#[derive(PartialEq, Debug, UtilsDefaultSerde)]
8+
#[derive(PartialEq, Debug, Clone, UtilsDefaultSerde)]
99
pub struct Date {
1010
pub value: NaiveDate,
1111
pub timezone: Option<FixedOffset>,
@@ -163,7 +163,7 @@ mod tests {
163163
);
164164
}
165165

166-
#[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)]
166+
#[derive(Default, Clone, PartialEq, Debug, YaSerialize, YaDeserialize)]
167167
#[yaserde(prefix = "t", namespace = "t: test")]
168168
pub struct Message {
169169
#[yaserde(prefix = "t", rename = "CreatedAt")]

xsd-types/src/types/datetime.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use std::{fmt, str::FromStr};
33
use chrono::{format::ParseError, DateTime as CDateTime, FixedOffset};
44
use xsd_macro_utils::UtilsDefaultSerde;
55

6-
#[derive(PartialEq, PartialOrd, Debug, UtilsDefaultSerde)]
6+
#[derive(PartialEq, PartialOrd, Debug, Clone, UtilsDefaultSerde)]
77
pub struct DateTime {
88
pub value: CDateTime<FixedOffset>,
99
}
@@ -106,7 +106,7 @@ mod tests {
106106
assert_eq!(DateTime { value: dt }.to_string(), "2020-03-07T04:40:00-06:30");
107107
}
108108

109-
#[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)]
109+
#[derive(Default, Clone, PartialEq, Debug, YaSerialize, YaDeserialize)]
110110
#[yaserde(prefix = "t", namespace = "t: test")]
111111
pub struct Message {
112112
#[yaserde(prefix = "t", rename = "CreatedAt")]

xsd-types/src/types/datetimestamp.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use xsd_macro_utils::UtilsDefaultSerde;
66
use crate::types::datetime::DateTime;
77

88
// The only difference from DateTime is that the time zone expression is required at the end of the value.
9-
#[derive(Default, PartialEq, PartialOrd, Debug, UtilsDefaultSerde)]
9+
#[derive(Default, Clone, PartialEq, PartialOrd, Debug, UtilsDefaultSerde)]
1010
pub struct DateTimeStamp {
1111
pub value: DateTime,
1212
}
@@ -114,7 +114,7 @@ mod tests {
114114
);
115115
}
116116

117-
#[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)]
117+
#[derive(Default, Clone, PartialEq, Debug, YaSerialize, YaDeserialize)]
118118
#[yaserde(prefix = "t", namespace = "t: test")]
119119
pub struct Message {
120120
#[yaserde(prefix = "t", rename = "CreatedAt")]

xsd-types/src/types/decimal.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use std::{fmt, str::FromStr};
33
use bigdecimal::{BigDecimal, ParseBigDecimalError};
44
use xsd_macro_utils::UtilsDefaultSerde;
55

6-
#[derive(Default, PartialEq, PartialOrd, Debug, UtilsDefaultSerde)]
6+
#[derive(Default, Clone, PartialEq, PartialOrd, Debug, UtilsDefaultSerde)]
77
pub struct Decimal(pub BigDecimal);
88

99
impl Decimal {
@@ -38,7 +38,7 @@ mod tests {
3838
use super::*;
3939
use crate::utils::xml_eq::assert_xml_eq;
4040

41-
#[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)]
41+
#[derive(Default, Clone, PartialEq, Debug, YaSerialize, YaDeserialize)]
4242
#[yaserde(prefix = "t", namespace = "t: test")]
4343
pub struct DecimalPair {
4444
#[yaserde(prefix = "t", rename = "First")]

xsd-types/src/types/duration.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use std::{fmt, fmt::Write, str::FromStr};
22

33
use xsd_macro_utils::UtilsDefaultSerde;
44

5-
#[derive(Default, PartialEq, PartialOrd, Debug, UtilsDefaultSerde)]
5+
#[derive(Default, Clone, PartialEq, PartialOrd, Debug, UtilsDefaultSerde)]
66
pub struct Duration {
77
pub is_negative: bool,
88

xsd-types/src/types/gday.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use xsd_macro_utils::UtilsDefaultSerde;
55

66
use crate::types::utils::parse_timezone;
77

8-
#[derive(PartialEq, Debug, UtilsDefaultSerde)]
8+
#[derive(PartialEq, Debug, Clone, UtilsDefaultSerde)]
99
pub struct GDay {
1010
pub value: i32,
1111
pub timezone: Option<FixedOffset>,
@@ -148,7 +148,7 @@ mod tests {
148148
);
149149
}
150150

151-
#[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)]
151+
#[derive(Default, Clone, PartialEq, Debug, YaSerialize, YaDeserialize)]
152152
#[yaserde(prefix = "t", namespace = "t: test")]
153153
pub struct Message {
154154
#[yaserde(prefix = "t", rename = "CreatedAt")]

xsd-types/src/types/gmonth.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use xsd_macro_utils::UtilsDefaultSerde;
55

66
use crate::types::utils::parse_timezone;
77

8-
#[derive(PartialEq, Debug, UtilsDefaultSerde)]
8+
#[derive(PartialEq, Debug, Clone, UtilsDefaultSerde)]
99
pub struct GMonth {
1010
pub value: i32,
1111
pub timezone: Option<FixedOffset>,
@@ -148,7 +148,7 @@ mod tests {
148148
);
149149
}
150150

151-
#[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)]
151+
#[derive(Default, Clone, PartialEq, Debug, YaSerialize, YaDeserialize)]
152152
#[yaserde(prefix = "t", namespace = "t: test")]
153153
pub struct Message {
154154
#[yaserde(prefix = "t", rename = "CreatedAt")]

xsd-types/src/types/gmonthday.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use xsd_macro_utils::UtilsDefaultSerde;
55

66
use crate::types::{gday::GDay, gmonth::GMonth, utils::parse_timezone};
77

8-
#[derive(PartialEq, Debug, UtilsDefaultSerde)]
8+
#[derive(PartialEq, Debug, Clone, UtilsDefaultSerde)]
99
pub struct GMonthDay {
1010
pub month: i32,
1111
pub day: i32,
@@ -199,7 +199,7 @@ mod tests {
199199
);
200200
}
201201

202-
#[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)]
202+
#[derive(Default, Clone, PartialEq, Debug, YaSerialize, YaDeserialize)]
203203
#[yaserde(prefix = "t", namespace = "t: test")]
204204
pub struct Message {
205205
#[yaserde(prefix = "t", rename = "CreatedAt")]

0 commit comments

Comments
 (0)