mirror of
https://git.asonix.dog/asonix/pict-rs
synced 2024-12-22 11:21:24 +00:00
Don't try parsing an internal format for OldDetails
This commit is contained in:
parent
329ce1a7b0
commit
721d9e1706
1 changed files with 4 additions and 9 deletions
|
@ -80,8 +80,6 @@ pub(crate) struct OldDetails {
|
||||||
frames: Option<u32>,
|
frames: Option<u32>,
|
||||||
content_type: crate::serde_str::Serde<mime::Mime>,
|
content_type: crate::serde_str::Serde<mime::Mime>,
|
||||||
created_at: MaybeHumanDate,
|
created_at: MaybeHumanDate,
|
||||||
#[serde(skip_serializing_if = "Option::is_none")]
|
|
||||||
format: Option<crate::formats::InternalFormat>,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl OldDetails {
|
impl OldDetails {
|
||||||
|
@ -92,15 +90,12 @@ impl OldDetails {
|
||||||
frames,
|
frames,
|
||||||
content_type,
|
content_type,
|
||||||
created_at,
|
created_at,
|
||||||
format,
|
|
||||||
} = self;
|
} = self;
|
||||||
|
|
||||||
let format = format.or_else(|| {
|
let format = crate::formats::InternalFormat::maybe_from_media_type(
|
||||||
crate::formats::InternalFormat::maybe_from_media_type(
|
&content_type,
|
||||||
&content_type,
|
self.frames.is_some(),
|
||||||
self.frames.is_some(),
|
)?;
|
||||||
)
|
|
||||||
})?;
|
|
||||||
|
|
||||||
Some(Details::from_parts_full(
|
Some(Details::from_parts_full(
|
||||||
format,
|
format,
|
||||||
|
|
Loading…
Reference in a new issue