0.1.4 breaks Serde support
russellbanks opened this issue · 1 comments
In 0.1.3, I was using oxilangtag = { version = "0.1.3", features = ["serde"] }
. This no longer works in 0.1.4 as it's been changed to dep:serde
in ac33682.
I noticed that the feature for serde support is called serialize
, so I changed the feature to that - oxilangtag = { version = "0.1.4", features = ["serialize"] }
. However, the actual code is gated behind the feature serde
which can no longer be enabled in 0.1.4. For example:
#[cfg(feature = "serde")]
impl<T: Serialize> Serialize for LanguageTag<T> {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
self.tag.serialize(serializer)
}
}
#[cfg(feature = "serde")]
impl<'de, T: Deref<Target = str> + Deserialize<'de>> Deserialize<'de> for LanguageTag<T> {
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<LanguageTag<T>, D::Error> {
use serde::de::Error;
Self::parse(T::deserialize(deserializer)?).map_err(D::Error::custom)
}
}
Either the feature to enable serde support should be called serde
or instances of #[cfg(feature = "serde")]
should be changed to #[cfg(feature = "serialize")]
.
Thank you for this amazing bug report and sorry for that! It's sad that semver-checks has no support for features yet. This should be fixed in v0.1.5.