Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix new compiler warnings #2151

Merged
merged 2 commits into from
Feb 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Cargo.toml.public-private-dependencies
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ cargo-features = ["public-dependency"]
[package]
name = "image"
version = "0.24.0-alpha"
edition = "2018"
rust-version = "1.56"
edition = "2021"
rust-version = "1.63.0"

license = "MIT"
description = "Imaging library written in Rust. Provides basic filters and decoders for the most common image formats."
Expand Down
1 change: 0 additions & 1 deletion src/animation.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use std::cmp::Ordering;
use std::iter::Iterator;
use std::time::Duration;

use crate::error::ImageResult;
Expand Down
1 change: 0 additions & 1 deletion src/codecs/avif/decoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
/// The [AVIF] specification defines an image derivative of the AV1 bitstream, an open video codec.
///
/// [AVIF]: https://aomediacodec.github.io/av1-avif/
use std::convert::TryFrom;
use std::error::Error;
use std::io::{self, Cursor, Read};
use std::marker::PhantomData;
Expand Down
3 changes: 1 addition & 2 deletions src/codecs/bmp/decoder.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use std::cmp::{self, Ordering};
use std::convert::TryFrom;
use std::io::{self, Cursor, Read, Seek, SeekFrom};
use std::iter::{repeat, Iterator, Rev};
use std::iter::{repeat, Rev};
use std::marker::PhantomData;
use std::slice::ChunksMut;
use std::{error, fmt, mem};
Expand Down
1 change: 0 additions & 1 deletion src/codecs/dxt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
//!
//! Note: this module only implements bare DXT encoding/decoding, it does not parse formats that can contain DXT files like .dds

use std::convert::TryFrom;
use std::io::{self, Read, Seek, SeekFrom, Write};

use crate::color::ColorType;
Expand Down
1 change: 0 additions & 1 deletion src/codecs/farbfeld.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
//! # Related Links
//! * <https://tools.suckless.org/farbfeld/> - the farbfeld specification

use std::convert::{TryFrom, TryInto};
use std::i64;
use std::io::{self, Read, Seek, SeekFrom, Write};

Expand Down
2 changes: 0 additions & 2 deletions src/codecs/gif.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@
//! ```
#![allow(clippy::while_let_loop)]

use std::convert::TryFrom;
use std::convert::TryInto;
use std::io::{self, Cursor, Read, Write};
use std::marker::PhantomData;
use std::mem;
Expand Down
3 changes: 0 additions & 3 deletions src/codecs/hdr/decoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ use crate::Primitive;
use num_traits::identities::Zero;
#[cfg(test)]
use std::borrow::Cow;
use std::convert::TryFrom;
use std::io::{self, BufRead, Cursor, Read, Seek};
use std::iter::Iterator;
use std::marker::PhantomData;
use std::num::{ParseFloatError, ParseIntError};
use std::path::Path;
Expand Down Expand Up @@ -1021,7 +1019,6 @@ pub fn read_raw_file<P: AsRef<Path>>(path: P) -> ::std::io::Result<Vec<Rgb<f32>>
#[cfg(test)]
mod test {
use super::*;
use std::io::Cursor;

#[test]
fn dimension_overflow() {
Expand Down
1 change: 0 additions & 1 deletion src/codecs/ico/decoder.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use byteorder::{LittleEndian, ReadBytesExt};
use std::convert::TryFrom;
use std::io::{self, Cursor, Read, Seek, SeekFrom};
use std::marker::PhantomData;
use std::{error, fmt, mem};
Expand Down
1 change: 0 additions & 1 deletion src/codecs/jpeg/decoder.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
use std::convert::TryFrom;
use std::io::{self, Cursor, Read};
use std::marker::PhantomData;
use std::mem;
Expand Down
1 change: 0 additions & 1 deletion src/codecs/jpeg/encoder.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#![allow(clippy::too_many_arguments)]

use std::borrow::Cow;
use std::convert::TryFrom;
use std::io::{self, Write};

use crate::error::{
Expand Down
4 changes: 1 addition & 3 deletions src/codecs/png.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
//! * <http://www.w3.org/TR/PNG/> - The PNG Specification
//!

use std::convert::TryFrom;
use std::fmt;
use std::io::{self, Read, Write};

Expand Down Expand Up @@ -790,10 +789,9 @@ impl std::error::Error for BadPngRepresentation {}
#[cfg(test)]
mod tests {
use super::*;
use crate::image::ImageDecoder;
use crate::ImageOutputFormat;

use std::io::{Cursor, Read};
use std::io::Cursor;

#[test]
fn ensure_no_decoder_off_by_one() {
Expand Down
2 changes: 0 additions & 2 deletions src/codecs/pnm/decoder.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
use std::convert::TryFrom;
use std::convert::TryInto;
use std::error;
use std::fmt::{self, Display};
use std::io::{self, BufRead, Cursor, Read};
Expand Down
1 change: 0 additions & 1 deletion src/codecs/tga/decoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ use crate::{
};
use byteorder::ReadBytesExt;
use std::{
convert::TryFrom,
io::{self, Read, Seek},
mem,
};
Expand Down
2 changes: 1 addition & 1 deletion src/codecs/tga/encoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use crate::{
codecs::tga::header::ImageType, error::EncodingError, ColorType, ImageEncoder, ImageError,
ImageFormat, ImageResult,
};
use std::{convert::TryFrom, error, fmt, io::Write};
use std::{error, fmt, io::Write};

/// Errors that can occur during encoding and saving of a TGA image.
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq, PartialOrd, Ord)]
Expand Down
1 change: 0 additions & 1 deletion src/codecs/tiff.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

extern crate tiff;

use std::convert::TryFrom;
use std::io::{self, Cursor, Read, Seek, Write};
use std::marker::PhantomData;
use std::mem;
Expand Down
1 change: 0 additions & 1 deletion src/codecs/webp/decoder.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use byteorder::{LittleEndian, ReadBytesExt};
use std::convert::TryFrom;
use std::io::{self, Cursor, Error, Read};
use std::marker::PhantomData;
use std::{error, fmt, mem};
Expand Down
1 change: 0 additions & 1 deletion src/codecs/webp/encoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ use std::collections::BinaryHeap;
///
/// [libwebp]: https://developers.google.com/speed/webp/docs/api#simple_encoding_api
use std::io::{self, Write};
use std::iter::FromIterator;
use std::slice::ChunksExact;

#[cfg(feature = "webp-encoder")]
Expand Down
1 change: 0 additions & 1 deletion src/codecs/webp/extended.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
use std::convert::TryInto;
use std::io::{self, Cursor, Error, Read, Seek};
use std::{error, fmt};

Expand Down
2 changes: 0 additions & 2 deletions src/codecs/webp/huffman.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
use std::convert::TryInto;

use super::lossless::BitReader;
use super::lossless::DecoderError;
use crate::ImageResult;
Expand Down
2 changes: 0 additions & 2 deletions src/codecs/webp/lossless.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
//!

use std::{
convert::TryFrom,
convert::TryInto,
error, fmt,
io::Read,
ops::{AddAssign, Shl},
Expand Down
3 changes: 0 additions & 3 deletions src/codecs/webp/lossless_transform.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
use std::convert::TryFrom;
use std::convert::TryInto;

use super::lossless::subsample_size;
use super::lossless::DecoderError;

Expand Down
1 change: 0 additions & 1 deletion src/codecs/webp/vp8.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
//!

use byteorder::{LittleEndian, ReadBytesExt};
use std::convert::TryInto;
use std::default::Default;
use std::io::Read;
use std::{cmp, error, fmt};
Expand Down
1 change: 0 additions & 1 deletion src/image.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#![allow(clippy::too_many_arguments)]
use std::convert::TryFrom;
use std::ffi::OsStr;
use std::io;
use std::io::Read;
Expand Down
2 changes: 1 addition & 1 deletion src/imageops/colorops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,7 @@ where
mod test {

use super::*;
use crate::{GrayImage, ImageBuffer};
use crate::GrayImage;

macro_rules! assert_pixels_eq {
($actual:expr, $expected:expr) => {{
Expand Down
2 changes: 0 additions & 2 deletions src/io/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
//! Input and output of images.

use std::convert::TryFrom;

use crate::{error, ColorType, ImageError, ImageResult};

pub(crate) mod free_functions;
Expand Down
1 change: 0 additions & 1 deletion tests/reference_images.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//! Compares the decoding results with reference renderings.
use std::convert::TryInto;
use std::fs;
use std::io;
use std::path::PathBuf;
Expand Down
Loading