Skip to content

Commit

Permalink
Return Info with static lifetime (#465)
Browse files Browse the repository at this point in the history
  • Loading branch information
fintelia committed Feb 4, 2024
1 parent 92540b3 commit a6425ca
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/decoder/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ impl<R: Read> Decoder<R> {
///
/// Most image metadata will not be read until `read_info` is called, so those fields will be
/// None or empty.
pub fn read_header_info(&mut self) -> Result<&Info, DecodingError> {
pub fn read_header_info(&mut self) -> Result<&Info<'static>, DecodingError> {
let mut buf = Vec::new();
while self.read_decoder.info().is_none() {
buf.clear();
Expand Down Expand Up @@ -345,7 +345,7 @@ impl<R: Read> ReadDecoder<R> {
))
}

fn info(&self) -> Option<&Info> {
fn info(&self) -> Option<&Info<'static>> {
self.decoder.info.as_ref()
}
}
Expand Down Expand Up @@ -466,7 +466,7 @@ impl<R: Read> Reader<R> {
/// Get information on the image.
///
/// The structure will change as new frames of an animated image are decoded.
pub fn info(&self) -> &Info {
pub fn info(&self) -> &Info<'static> {
self.decoder.info().unwrap()
}

Expand Down

0 comments on commit a6425ca

Please sign in to comment.