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>,
|
||||
content_type: crate::serde_str::Serde<mime::Mime>,
|
||||
created_at: MaybeHumanDate,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
format: Option<crate::formats::InternalFormat>,
|
||||
}
|
||||
|
||||
impl OldDetails {
|
||||
|
@ -92,15 +90,12 @@ impl OldDetails {
|
|||
frames,
|
||||
content_type,
|
||||
created_at,
|
||||
format,
|
||||
} = self;
|
||||
|
||||
let format = format.or_else(|| {
|
||||
crate::formats::InternalFormat::maybe_from_media_type(
|
||||
&content_type,
|
||||
self.frames.is_some(),
|
||||
)
|
||||
})?;
|
||||
let format = crate::formats::InternalFormat::maybe_from_media_type(
|
||||
&content_type,
|
||||
self.frames.is_some(),
|
||||
)?;
|
||||
|
||||
Some(Details::from_parts_full(
|
||||
format,
|
||||
|
|
Loading…
Reference in a new issue