Stop using unstable slice_patterns feature

This commit is contained in:
Matt Brubeck 2017-05-01 14:17:37 -07:00
parent e92a79619e
commit 10478b4fa3
5 changed files with 5 additions and 10 deletions

View file

@ -108,10 +108,7 @@ pub fn detect_image_format(buffer: &[u8]) -> Result<ImageFormat, &str> {
}
fn is_gif(buffer: &[u8]) -> bool {
match buffer {
&[b'G', b'I', b'F', b'8', n, b'a', _..] if n == b'7' || n == b'9' => true,
_ => false,
}
buffer.starts_with(b"GIF87a") || buffer.starts_with(b"GIF89a")
}
fn is_jpeg(buffer: &[u8]) -> bool {