Skip to content

Commit

Permalink
Merge pull request #167 from patrickelectric/clone
Browse files Browse the repository at this point in the history
Add clone do types and generated code
  • Loading branch information
DmitrySamoylov authored Sep 19, 2024
2 parents 03328f5 + 075f6b0 commit d476e85
Show file tree
Hide file tree
Showing 40 changed files with 70 additions and 69 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ There are cases when schema allows extensions for the certain type.
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:

```rust
#[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)]
#[derive(Default, Clone, PartialEq, Debug, YaSerialize, YaDeserialize)]
#[yaserde(prefix = "tns", namespace = "tns: http://example.com")]
pub struct MyType {
#[yaserde(prefix = "tns", rename = "Parameters")]
Expand Down
4 changes: 2 additions & 2 deletions wsdl-parser/tests/port_type_to_function/expected.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

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


#[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)]
#[derive(Default, Clone, PartialEq, Debug, YaSerialize, YaDeserialize)]
#[yaserde(prefix = "tds", namespace = "tds: http://www.onvif.org/ver10/device/wsdl")]
pub struct GetServicesResponse {
// Each Service element contains information about one service.
Expand Down
2 changes: 1 addition & 1 deletion xsd-parser/src/generator/enum.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ pub trait EnumGenerator {
return "#[derive(PartialEq, Debug, UtilsUnionSerDe)]".into();
}

let derives = "#[derive(PartialEq, Debug, YaSerialize, YaDeserialize)]";
let derives = "#[derive(PartialEq, Debug, Clone, YaSerialize, YaDeserialize)]";
let tns = gen.target_ns.borrow();
match tns.as_ref() {
Some(tn) => match tn.name() {
Expand Down
3 changes: 2 additions & 1 deletion xsd-parser/src/generator/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ mod test {
..Default::default()
}));
let comment = "// comment\n";
let macros = "#[derive(Default, PartialEq, Debug, UtilsTupleIo, UtilsDefaultSerde)]\n";
let macros =
"#[derive(Default, Clone, PartialEq, Debug, UtilsTupleIo, UtilsDefaultSerde)]\n";
let validation = "impl Validate for Name {}\n";
let expected =
format!("{}{}pub struct Name (pub Type);\n\n{}", comment, macros, validation);
Expand Down
2 changes: 1 addition & 1 deletion xsd-parser/src/generator/struct.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ pub trait StructGenerator {
}

fn macros(&self, _entity: &Struct, gen: &Generator) -> Cow<'static, str> {
let derives = "#[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)]\n";
let derives = "#[derive(Default, Clone, PartialEq, Debug, YaSerialize, YaDeserialize)]\n";
let tns = gen.target_ns.borrow();
match tns.as_ref() {
Some(tn) => match tn.name() {
Expand Down
2 changes: 1 addition & 1 deletion xsd-parser/src/generator/tuple_struct.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ pub trait TupleStructGenerator {
}

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

fn format_comment(&self, entity: &TupleStruct, gen: &Generator) -> String {
Expand Down
2 changes: 1 addition & 1 deletion xsd-parser/tests/all/expected.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)]
#[derive(Default, Clone, PartialEq, Debug, YaSerialize, YaDeserialize)]
#[yaserde(prefix = "tns", namespace = "tns: http://example.com")]
pub struct FooType {
#[yaserde(prefix = "tns", rename = "Once")]
Expand Down
2 changes: 1 addition & 1 deletion xsd-parser/tests/any/expected.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)]
#[derive(Default, Clone, PartialEq, Debug, YaSerialize, YaDeserialize)]
#[yaserde(prefix = "tns", namespace = "tns: http://example.com")]
pub struct FooType {
#[yaserde(prefix = "tns", rename = "Name")]
Expand Down
8 changes: 4 additions & 4 deletions xsd-parser/tests/choice/expected.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#[derive(Default, PartialEq, Debug, UtilsTupleIo, UtilsDefaultSerde)]
#[derive(Default, Clone, PartialEq, Debug, UtilsTupleIo, UtilsDefaultSerde)]
pub struct BarType(pub String);

#[derive(Default, PartialEq, Debug, UtilsTupleIo, UtilsDefaultSerde)]
#[derive(Default, Clone, PartialEq, Debug, UtilsTupleIo, UtilsDefaultSerde)]
pub struct BazType(pub i32);

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

#[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)]
#[derive(Default, Clone, PartialEq, Debug, YaSerialize, YaDeserialize)]
#[yaserde(prefix = "tns", namespace = "tns: http://example.com")]
pub struct FooType {
#[yaserde(flatten)]
Expand Down
2 changes: 1 addition & 1 deletion xsd-parser/tests/complex_type/expected.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)]
#[derive(Default, Clone, PartialEq, Debug, YaSerialize, YaDeserialize)]
#[yaserde(prefix = "tns", namespace = "tns: http://example.com")]
pub struct FooType {
#[yaserde(prefix = "tns", rename = "Min")]
Expand Down
8 changes: 4 additions & 4 deletions xsd-parser/tests/complex_type_subtypes_clash/expected.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)]
#[derive(Default, Clone, PartialEq, Debug, YaSerialize, YaDeserialize)]
#[yaserde(prefix = "tns", namespace = "tns: http://example.com")]
pub struct FooType {
#[yaserde(prefix = "tns", rename = "Extension")]
Expand All @@ -10,14 +10,14 @@ impl Validate for FooType {}
pub mod foo_type {
use super::*;

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

impl Validate for ExtensionType {}
}

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

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

Expand Down
4 changes: 2 additions & 2 deletions xsd-parser/tests/enumeration/expected.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#[derive(PartialEq, Debug, YaSerialize, YaDeserialize)]
#[derive(PartialEq, Debug, Clone, YaSerialize, YaDeserialize)]
#[yaserde(prefix = "tns", namespace = "tns: http://example.com")]
pub enum FooType {
#[yaserde(rename = "OFF")]
Expand All @@ -18,7 +18,7 @@ impl Default for FooType {
impl Validate for FooType {}


#[derive(Default, PartialEq, Debug, UtilsTupleIo, UtilsDefaultSerde)]
#[derive(Default, Clone, PartialEq, Debug, UtilsTupleIo, UtilsDefaultSerde)]
pub struct FooType2(pub String);

impl Validate for FooType2 {}
Expand Down
4 changes: 2 additions & 2 deletions xsd-parser/tests/extension_base/expected.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)]
#[derive(Default, Clone, PartialEq, Debug, YaSerialize, YaDeserialize)]
#[yaserde(prefix = "tns", namespace = "tns: http://example.com")]
pub struct BarType {
#[yaserde(prefix = "tns", rename = "b")]
Expand All @@ -10,7 +10,7 @@ pub struct BarType {

impl Validate for BarType {}

#[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)]
#[derive(Default, Clone, PartialEq, Debug, YaSerialize, YaDeserialize)]
#[yaserde(prefix = "tns", namespace = "tns: http://example.com")]
pub struct FooType {
#[yaserde(prefix = "tns", rename = "a")]
Expand Down
6 changes: 3 additions & 3 deletions xsd-parser/tests/extension_base_multilayer/expected.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)]
#[derive(Default, Clone, PartialEq, Debug, YaSerialize, YaDeserialize)]
#[yaserde(prefix = "tns", namespace = "tns: http://example.com")]
pub struct BarType {
#[yaserde(prefix = "tns", rename = "aa")]
Expand All @@ -10,7 +10,7 @@ pub struct BarType {

impl Validate for BarType {}

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

#[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)]
#[derive(Default, Clone, PartialEq, Debug, YaSerialize, YaDeserialize)]
#[yaserde(prefix = "tns", namespace = "tns: http://example.com")]
pub struct MessagesType {
#[yaserde(prefix = "tns", rename = "a")]
Expand Down
2 changes: 1 addition & 1 deletion xsd-parser/tests/extension_base_two_files/expected.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)]
#[derive(Default, Clone, PartialEq, Debug, YaSerialize, YaDeserialize)]
#[yaserde(
prefix = "tns",
namespace = "tns: http://example.com",
Expand Down
4 changes: 2 additions & 2 deletions xsd-parser/tests/ref_to_attribute/expected.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#[derive(Default, PartialEq, Debug, UtilsTupleIo, UtilsDefaultSerde)]
#[derive(Default, Clone, PartialEq, Debug, UtilsTupleIo, UtilsDefaultSerde)]
pub struct Id(pub String);

impl Validate for Id {}
#[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)]
#[derive(Default, Clone, PartialEq, Debug, YaSerialize, YaDeserialize)]
#[yaserde(prefix = "tns", namespace = "tns: http://example.com")]
pub struct FooType {
#[yaserde(attribute, prefix = "tns", rename = "id")]
Expand Down
2 changes: 1 addition & 1 deletion xsd-parser/tests/rename_only_where_needed/expected.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)]
#[derive(Default, Clone, PartialEq, Debug, YaSerialize, YaDeserialize)]
#[yaserde(prefix = "tns", namespace = "tns: http://example.com")]
pub struct FooType {
#[yaserde(prefix = "tns")]
Expand Down
2 changes: 1 addition & 1 deletion xsd-parser/tests/restriction_any_type/expected.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// pub type AppSequence = AppSequenceType;
#[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)]
#[derive(Default, Clone, PartialEq, Debug, YaSerialize, YaDeserialize)]
#[yaserde(prefix = "tns", namespace = "tns: http://schemas.xmlsoap.org/ws/2005/04/discovery")]
pub struct AppSequenceType {
#[yaserde(attribute, rename = "InstanceId")]
Expand Down
2 changes: 1 addition & 1 deletion xsd-parser/tests/simple_type/expected.rs
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#[derive(Default, PartialEq, Debug, UtilsTupleIo, UtilsDefaultSerde)]
#[derive(Default, Clone, PartialEq, Debug, UtilsTupleIo, UtilsDefaultSerde)]
pub struct FooType (pub String);
2 changes: 1 addition & 1 deletion xsd-parser/tests/tuple_with_integer/expected.rs
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#[derive(Default, PartialEq, Debug, UtilsTupleIo, UtilsDefaultSerde)]
#[derive(Default, Clone, PartialEq, Debug, UtilsTupleIo, UtilsDefaultSerde)]
pub struct FooType (pub Integer);
2 changes: 1 addition & 1 deletion xsd-parser/tests/tuple_with_string/expected.rs
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#[derive(Default, PartialEq, Debug, UtilsTupleIo, UtilsDefaultSerde)]
#[derive(Default, Clone, PartialEq, Debug, UtilsTupleIo, UtilsDefaultSerde)]
pub struct FooType(pub String);
2 changes: 1 addition & 1 deletion xsd-parser/tests/tuple_with_vec/expected.rs
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#[derive(Default, PartialEq, Debug, UtilsTupleIo, UtilsDefaultSerde)]
#[derive(Default, Clone, PartialEq, Debug, UtilsTupleIo, UtilsDefaultSerde)]
pub struct FooType(pub Vec<i32>);
6 changes: 3 additions & 3 deletions xsd-parser/tests/type_name_clash/expected.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)]
#[derive(Default, Clone, PartialEq, Debug, YaSerialize, YaDeserialize)]
#[yaserde(prefix = "tns", namespace = "tns: http://example.com")]
pub struct BarType {
#[yaserde(attribute, rename = "a")]
Expand All @@ -8,7 +8,7 @@ pub struct BarType {
impl Validate for BarType {}


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

#[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)]
#[derive(Default, Clone, PartialEq, Debug, YaSerialize, YaDeserialize)]
#[yaserde(prefix = "tns", namespace = "tns: http://example.com")]
pub struct BarType {
#[yaserde(attribute, rename = "b")]
Expand Down
2 changes: 1 addition & 1 deletion xsd-parser/tests/xsd_string/expected.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)]
#[derive(Default, Clone, PartialEq, Debug, YaSerialize, YaDeserialize)]
#[yaserde(prefix = "tns", namespace = "tns: http://example.com")]
pub struct FooType {
#[yaserde(prefix = "tns", rename = "Text")]
Expand Down
4 changes: 2 additions & 2 deletions xsd-types/src/types/date.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use xsd_macro_utils::UtilsDefaultSerde;

use crate::types::utils::parse_timezone;

#[derive(PartialEq, Debug, UtilsDefaultSerde)]
#[derive(PartialEq, Debug, Clone, UtilsDefaultSerde)]
pub struct Date {
pub value: NaiveDate,
pub timezone: Option<FixedOffset>,
Expand Down Expand Up @@ -163,7 +163,7 @@ mod tests {
);
}

#[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)]
#[derive(Default, Clone, PartialEq, Debug, YaSerialize, YaDeserialize)]
#[yaserde(prefix = "t", namespace = "t: test")]
pub struct Message {
#[yaserde(prefix = "t", rename = "CreatedAt")]
Expand Down
4 changes: 2 additions & 2 deletions xsd-types/src/types/datetime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use std::{fmt, str::FromStr};
use chrono::{format::ParseError, DateTime as CDateTime, FixedOffset};
use xsd_macro_utils::UtilsDefaultSerde;

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

#[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)]
#[derive(Default, Clone, PartialEq, Debug, YaSerialize, YaDeserialize)]
#[yaserde(prefix = "t", namespace = "t: test")]
pub struct Message {
#[yaserde(prefix = "t", rename = "CreatedAt")]
Expand Down
4 changes: 2 additions & 2 deletions xsd-types/src/types/datetimestamp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use xsd_macro_utils::UtilsDefaultSerde;
use crate::types::datetime::DateTime;

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

#[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)]
#[derive(Default, Clone, PartialEq, Debug, YaSerialize, YaDeserialize)]
#[yaserde(prefix = "t", namespace = "t: test")]
pub struct Message {
#[yaserde(prefix = "t", rename = "CreatedAt")]
Expand Down
4 changes: 2 additions & 2 deletions xsd-types/src/types/decimal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use std::{fmt, str::FromStr};
use bigdecimal::{BigDecimal, ParseBigDecimalError};
use xsd_macro_utils::UtilsDefaultSerde;

#[derive(Default, PartialEq, PartialOrd, Debug, UtilsDefaultSerde)]
#[derive(Default, Clone, PartialEq, PartialOrd, Debug, UtilsDefaultSerde)]
pub struct Decimal(pub BigDecimal);

impl Decimal {
Expand Down Expand Up @@ -38,7 +38,7 @@ mod tests {
use super::*;
use crate::utils::xml_eq::assert_xml_eq;

#[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)]
#[derive(Default, Clone, PartialEq, Debug, YaSerialize, YaDeserialize)]
#[yaserde(prefix = "t", namespace = "t: test")]
pub struct DecimalPair {
#[yaserde(prefix = "t", rename = "First")]
Expand Down
2 changes: 1 addition & 1 deletion xsd-types/src/types/duration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use std::{fmt, fmt::Write, str::FromStr};

use xsd_macro_utils::UtilsDefaultSerde;

#[derive(Default, PartialEq, PartialOrd, Debug, UtilsDefaultSerde)]
#[derive(Default, Clone, PartialEq, PartialOrd, Debug, UtilsDefaultSerde)]
pub struct Duration {
pub is_negative: bool,

Expand Down
4 changes: 2 additions & 2 deletions xsd-types/src/types/gday.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use xsd_macro_utils::UtilsDefaultSerde;

use crate::types::utils::parse_timezone;

#[derive(PartialEq, Debug, UtilsDefaultSerde)]
#[derive(PartialEq, Debug, Clone, UtilsDefaultSerde)]
pub struct GDay {
pub value: i32,
pub timezone: Option<FixedOffset>,
Expand Down Expand Up @@ -148,7 +148,7 @@ mod tests {
);
}

#[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)]
#[derive(Default, Clone, PartialEq, Debug, YaSerialize, YaDeserialize)]
#[yaserde(prefix = "t", namespace = "t: test")]
pub struct Message {
#[yaserde(prefix = "t", rename = "CreatedAt")]
Expand Down
4 changes: 2 additions & 2 deletions xsd-types/src/types/gmonth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use xsd_macro_utils::UtilsDefaultSerde;

use crate::types::utils::parse_timezone;

#[derive(PartialEq, Debug, UtilsDefaultSerde)]
#[derive(PartialEq, Debug, Clone, UtilsDefaultSerde)]
pub struct GMonth {
pub value: i32,
pub timezone: Option<FixedOffset>,
Expand Down Expand Up @@ -148,7 +148,7 @@ mod tests {
);
}

#[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)]
#[derive(Default, Clone, PartialEq, Debug, YaSerialize, YaDeserialize)]
#[yaserde(prefix = "t", namespace = "t: test")]
pub struct Message {
#[yaserde(prefix = "t", rename = "CreatedAt")]
Expand Down
4 changes: 2 additions & 2 deletions xsd-types/src/types/gmonthday.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use xsd_macro_utils::UtilsDefaultSerde;

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

#[derive(PartialEq, Debug, UtilsDefaultSerde)]
#[derive(PartialEq, Debug, Clone, UtilsDefaultSerde)]
pub struct GMonthDay {
pub month: i32,
pub day: i32,
Expand Down Expand Up @@ -199,7 +199,7 @@ mod tests {
);
}

#[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)]
#[derive(Default, Clone, PartialEq, Debug, YaSerialize, YaDeserialize)]
#[yaserde(prefix = "t", namespace = "t: test")]
pub struct Message {
#[yaserde(prefix = "t", rename = "CreatedAt")]
Expand Down
Loading

0 comments on commit d476e85

Please sign in to comment.