diff --git a/instant-xml-macros/src/ser.rs b/instant-xml-macros/src/ser.rs index 7fb9cb9..95ed660 100644 --- a/instant-xml-macros/src/ser.rs +++ b/instant-xml-macros/src/ser.rs @@ -70,8 +70,6 @@ fn serialize_scalar_enum( Ok(()) } - - const KIND: ::instant_xml::Kind<'static> = ::instant_xml::Kind::Scalar; } ) } @@ -165,11 +163,6 @@ fn serialize_wrapped_enum( Ok(()) } - - const KIND: ::instant_xml::Kind<'static> = ::instant_xml::Kind::Element(::instant_xml::Id { - ns: #default_namespace, - name: #tag, - }); }; ) } @@ -252,11 +245,6 @@ fn serialize_struct( serializer.pop(old); Ok(()) } - - const KIND: ::instant_xml::Kind<'static> = ::instant_xml::Kind::Element(::instant_xml::Id { - ns: #default_namespace, - name: #tag, - }); }; ) } diff --git a/instant-xml/src/impls.rs b/instant-xml/src/impls.rs index 6f86422..c110865 100644 --- a/instant-xml/src/impls.rs +++ b/instant-xml/src/impls.rs @@ -100,8 +100,6 @@ where Ok(()) } - - const KIND: Kind<'static> = Kind::Scalar; } macro_rules! to_xml_for_number { @@ -114,8 +112,6 @@ macro_rules! to_xml_for_number { ) -> Result<(), Error> { DisplayToXml(self).serialize(field, serializer) } - - const KIND: Kind<'static> = DisplayToXml::::KIND; } }; } @@ -357,8 +353,6 @@ impl ToXml for bool { DisplayToXml(&value).serialize(field, serializer) } - - const KIND: Kind<'static> = DisplayToXml::::KIND; } impl ToXml for String { @@ -369,8 +363,6 @@ impl ToXml for String { ) -> Result<(), Error> { DisplayToXml(&encode(self)?).serialize(field, serializer) } - - const KIND: Kind<'static> = DisplayToXml::::KIND; } impl ToXml for char { @@ -382,8 +374,6 @@ impl ToXml for char { let mut tmp = [0u8; 4]; DisplayToXml(&encode(&*self.encode_utf8(&mut tmp))?).serialize(field, serializer) } - - const KIND: Kind<'static> = DisplayToXml::::KIND; } impl ToXml for &str { @@ -394,8 +384,6 @@ impl ToXml for &str { ) -> Result<(), Error> { DisplayToXml(&encode(self)?).serialize(field, serializer) } - - const KIND: Kind<'static> = DisplayToXml::::KIND; } impl ToXml for Cow<'_, str> { @@ -406,8 +394,6 @@ impl ToXml for Cow<'_, str> { ) -> Result<(), Error> { DisplayToXml(&encode(self)?).serialize(field, serializer) } - - const KIND: Kind<'static> = DisplayToXml::::KIND; } impl ToXml for Option { @@ -421,8 +407,6 @@ impl ToXml for Option { None => Ok(()), } } - - const KIND: Kind<'static> = T::KIND; } fn encode(input: &str) -> Result, Error> { @@ -545,8 +529,6 @@ impl ToXml for Vec { Ok(()) } - - const KIND: Kind<'static> = T::KIND; } #[cfg(feature = "chrono")] @@ -572,8 +554,6 @@ impl ToXml for DateTime { Ok(()) } - - const KIND: Kind<'static> = Kind::Scalar; } #[cfg(feature = "chrono")] @@ -635,8 +615,6 @@ impl ToXml for IpAddr { ) -> Result<(), Error> { DisplayToXml(self).serialize(field, serializer) } - - const KIND: Kind<'static> = Kind::Scalar; } impl<'xml> FromXml<'xml> for IpAddr { diff --git a/instant-xml/src/lib.rs b/instant-xml/src/lib.rs index 828d839..22852f5 100644 --- a/instant-xml/src/lib.rs +++ b/instant-xml/src/lib.rs @@ -19,8 +19,6 @@ pub trait ToXml { field: Option>, serializer: &mut Serializer, ) -> Result<(), Error>; - - const KIND: Kind<'static>; } impl<'a, T: ToXml + ?Sized> ToXml for &'a T { @@ -31,8 +29,6 @@ impl<'a, T: ToXml + ?Sized> ToXml for &'a T { ) -> Result<(), Error> { (*self).serialize(field, serializer) } - - const KIND: Kind<'static> = T::KIND; } pub trait FromXml<'xml>: Sized {