Remove unused ToXml::KIND const

This commit is contained in:
Dirkjan Ochtman 2022-11-29 16:16:27 +01:00
parent 4768d092ca
commit 4eafa193bd
3 changed files with 0 additions and 38 deletions

View File

@ -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,
});
};
)
}

View File

@ -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::<Self>::KIND;
}
};
}
@ -357,8 +353,6 @@ impl ToXml for bool {
DisplayToXml(&value).serialize(field, serializer)
}
const KIND: Kind<'static> = DisplayToXml::<Self>::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::<Self>::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::<Self>::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::<Self>::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::<Self>::KIND;
}
impl<T: ToXml> ToXml for Option<T> {
@ -421,8 +407,6 @@ impl<T: ToXml> ToXml for Option<T> {
None => Ok(()),
}
}
const KIND: Kind<'static> = T::KIND;
}
fn encode(input: &str) -> Result<Cow<'_, str>, Error> {
@ -545,8 +529,6 @@ impl<T: ToXml> ToXml for Vec<T> {
Ok(())
}
const KIND: Kind<'static> = T::KIND;
}
#[cfg(feature = "chrono")]
@ -572,8 +554,6 @@ impl ToXml for DateTime<Utc> {
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 {

View File

@ -19,8 +19,6 @@ pub trait ToXml {
field: Option<Id<'_>>,
serializer: &mut Serializer<W>,
) -> 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 {