Skip to content

Commit

Permalink
Merge pull request #1059 from JohnTitor/remove-redundant-code
Browse files Browse the repository at this point in the history
Remove redundant code
  • Loading branch information
HeroicKatora committed Oct 15, 2019
2 parents 9aae0b0 + f26d338 commit e48d283
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/io/free_functions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ pub(crate) fn guess_format_from_path_impl(path: &Path) -> Result<ImageFormat, Pa
})
}

static MAGIC_BYTES: [(&'static [u8], ImageFormat); 17] = [
static MAGIC_BYTES: [(&[u8], ImageFormat); 17] = [
(b"\x89PNG\r\n\x1a\n", ImageFormat::PNG),
(&[0xff, 0xd8, 0xff], ImageFormat::JPEG),
(b"GIF89a", ImageFormat::GIF),
Expand Down
3 changes: 1 addition & 2 deletions src/tga/decoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -239,8 +239,7 @@ impl<R: Read + Seek> TGADecoder<R> {
} else {
if num_alpha_bits > self.header.pixel_depth {
return Err(ImageError::UnsupportedError(
format!("Color format not supported. Alpha bits: {}", num_alpha_bits)
.to_string(),
format!("Color format not supported. Alpha bits: {}", num_alpha_bits),
));
}

Expand Down

0 comments on commit e48d283

Please sign in to comment.