Skip to content

Commit

Permalink
This causes an internal compiler error
Browse files Browse the repository at this point in the history
  • Loading branch information
andersk committed Apr 6, 2015
1 parent e7057dc commit a9d74e9
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/png/decoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -242,9 +242,12 @@ impl<R: Read> PNGDecoder<R> {
)))
}

self.interlace_method = match FromPrimitive::from_u8(try!(try!(m.by_ref().bytes().next().ok_or(ImageError::ImageEnd)))) {
Some(method) => method,
None => return Err(ImageError::UnsupportedError(
const NONE_U8: u8 = InterlaceMethod::None as u8;
const ADAM7_U8: u8 = InterlaceMethod::Adam7 as u8;
self.interlace_method = match try!(try!(m.by_ref().bytes().next().ok_or(ImageError::ImageEnd))) {
NONE_U8 => InterlaceMethod::None,
ADAM7_U8 => InterlaceMethod::Adam7,
_ => return Err(ImageError::UnsupportedError(
"Unsupported interlace method.".to_string()
))
};
Expand Down

0 comments on commit a9d74e9

Please sign in to comment.