Remove unused parts of UrlDef
@@ -3,11 +3,10 @@ use serde::de::{Deserialize, Deserializer, Error as DeserializeError};
use serde::ser::{Serialize, Serializer};
-/// Type which can be used to serialize a Url.
+/// Unit struct which can be used to serialize a Url.
///
/// `#[serde(with = "UrlDef")]`
-pub struct UrlDef(Url);
-
+pub struct UrlDef;
impl UrlDef {
pub fn deserialize<'de, D>(deserializer: D) -> Result<Url, D::Error>
where D: Deserializer<'de> {
@@ -21,9 +20,3 @@ impl UrlDef {
url.as_str().serialize(serializer)
}
}
-
-impl From<UrlDef> for Url {
- fn from(def: UrlDef) -> Url {
- def.0
- }
-}
