Remove serialize impl from legacy structs

This commit is contained in:
Edward Shen 2021-07-12 13:43:47 -04:00
parent 20e349fd79
commit e8bea39100
Signed by: edward
GPG key ID: 19182661E818369F

11
src/cache/compat.rs vendored
View file

@ -9,7 +9,7 @@ use serde::{Deserialize, Serialize};
use super::ImageContentType; use super::ImageContentType;
#[derive(Copy, Clone, Serialize, Deserialize)] #[derive(Copy, Clone, Deserialize)]
pub struct LegacyImageMetadata { pub struct LegacyImageMetadata {
pub(crate) content_type: Option<LegacyImageContentType>, pub(crate) content_type: Option<LegacyImageContentType>,
pub(crate) size: Option<u32>, pub(crate) size: Option<u32>,
@ -50,15 +50,6 @@ impl<'de> Deserialize<'de> for LegacyDateTime {
#[derive(Copy, Clone)] #[derive(Copy, Clone)]
pub struct LegacyImageContentType(pub ImageContentType); pub struct LegacyImageContentType(pub ImageContentType);
impl Serialize for LegacyImageContentType {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.0.as_ref())
}
}
impl<'de> Deserialize<'de> for LegacyImageContentType { impl<'de> Deserialize<'de> for LegacyImageContentType {
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where where