diff --git a/src/codecs/avif/encoder.rs b/src/codecs/avif/encoder.rs index c29e2d1a5e..58cbe4c506 100644 --- a/src/codecs/avif/encoder.rs +++ b/src/codecs/avif/encoder.rs @@ -221,7 +221,7 @@ impl AvifEncoder { } Ok(RgbColor::Rgb8(Img::new( - rgb::AsPixels::as_pixels(data), + AsPixels::as_pixels(data), width as usize, height as usize, ))) @@ -238,7 +238,7 @@ impl AvifEncoder { } Ok(RgbColor::Rgba8(Img::new( - rgb::AsPixels::as_pixels(data), + AsPixels::as_pixels(data), width as usize, height as usize, ))) diff --git a/src/codecs/bmp/decoder.rs b/src/codecs/bmp/decoder.rs index 575d99603b..77a7712232 100644 --- a/src/codecs/bmp/decoder.rs +++ b/src/codecs/bmp/decoder.rs @@ -1407,7 +1407,7 @@ mod test { fn read_rect() { let f = BufReader::new(std::fs::File::open("tests/images/bmp/images/Core_8_Bit.bmp").unwrap()); - let mut decoder = super::BmpDecoder::new(f).unwrap(); + let mut decoder = BmpDecoder::new(f).unwrap(); let mut buf: Vec = vec![0; 8 * 8 * 3]; decoder.read_rect(0, 0, 8, 8, &mut buf, 8 * 3).unwrap(); @@ -1436,7 +1436,7 @@ mod test { 0x4d, 0x00, 0x2a, 0x00, ]; - let decoder = BmpDecoder::new(std::io::Cursor::new(&data)).unwrap(); + let decoder = BmpDecoder::new(Cursor::new(&data)).unwrap(); let mut buf = vec![0; usize::try_from(decoder.total_bytes()).unwrap()]; assert!(decoder.read_image(&mut buf).is_ok()); } diff --git a/src/codecs/gif.rs b/src/codecs/gif.rs index d1c6a98db7..618e3b605e 100644 --- a/src/codecs/gif.rs +++ b/src/codecs/gif.rs @@ -588,7 +588,7 @@ impl GifEncoder { gif_encoder = self.gif_encoder.as_mut().unwrap() } - frame.dispose = gif::DisposalMethod::Background; + frame.dispose = DisposalMethod::Background; gif_encoder .write_frame(&frame) diff --git a/src/codecs/hdr/decoder.rs b/src/codecs/hdr/decoder.rs index 069372b0b7..c704f1ab8d 100644 --- a/src/codecs/hdr/decoder.rs +++ b/src/codecs/hdr/decoder.rs @@ -686,7 +686,7 @@ fn split_at_first<'a>(s: &'a str, separator: &str) -> Option<(&'a str, &'a str)> // Reads input until b"\n" or EOF // Returns vector of read bytes NOT including end of line characters // or return None to indicate end of file -fn read_line_u8(r: &mut R) -> ::std::io::Result>> { +fn read_line_u8(r: &mut R) -> io::Result>> { let mut ret = Vec::with_capacity(16); loop { let mut byte = [0]; @@ -734,7 +734,7 @@ mod tests { #[test] fn read_line_u8_test() { let buf: Vec<_> = (&b"One\nTwo\nThree\nFour\n\n\n"[..]).into(); - let input = &mut ::std::io::Cursor::new(buf); + let input = &mut Cursor::new(buf); assert_eq!(&read_line_u8(input).unwrap().unwrap()[..], &b"One"[..]); assert_eq!(&read_line_u8(input).unwrap().unwrap()[..], &b"Two"[..]); assert_eq!(&read_line_u8(input).unwrap().unwrap()[..], &b"Three"[..]); diff --git a/src/codecs/hdr/encoder.rs b/src/codecs/hdr/encoder.rs index 86b4fcf189..ddda38ad69 100644 --- a/src/codecs/hdr/encoder.rs +++ b/src/codecs/hdr/encoder.rs @@ -421,7 +421,7 @@ fn noruncombine_test() { assert_eq!(rsi.next(), Some(Norun(129, 7))); assert_eq!(rsi.next(), None); - let v: Vec<_> = ::std::iter::repeat(()) + let v: Vec<_> = std::iter::repeat(()) .flat_map(|_| (0..2)) .take(257) .collect(); diff --git a/src/codecs/openexr.rs b/src/codecs/openexr.rs index 661be5b26d..4ddffe3a41 100644 --- a/src/codecs/openexr.rs +++ b/src/codecs/openexr.rs @@ -228,7 +228,7 @@ fn write_buffer( match color_type { ExtendedColorType::Rgb32F => { - exr::prelude::Image // TODO compression method zip?? + Image // TODO compression method zip?? ::from_channels( (width, height), SpecificChannels::rgb(|pixel: Vec2| { @@ -249,7 +249,7 @@ fn write_buffer( } ExtendedColorType::Rgba32F => { - exr::prelude::Image // TODO compression method zip?? + Image // TODO compression method zip?? ::from_channels( (width, height), SpecificChannels::rgba(|pixel: Vec2| { @@ -374,12 +374,12 @@ mod test { /// Read the file from the specified path into an `Rgba32FImage`. fn read_as_rgba_image_from_file(path: impl AsRef) -> ImageResult { - read_as_rgba_image(BufReader::new(std::fs::File::open(path)?)) + read_as_rgba_image(BufReader::new(File::open(path)?)) } /// Read the file from the specified path into an `Rgb32FImage`. fn read_as_rgb_image_from_file(path: impl AsRef) -> ImageResult { - read_as_rgb_image(BufReader::new(std::fs::File::open(path)?)) + read_as_rgb_image(BufReader::new(File::open(path)?)) } /// Read the file from the specified path into an `Rgb32FImage`. diff --git a/src/dynimage.rs b/src/dynimage.rs index 2fd3b56a7c..5db281c139 100644 --- a/src/dynimage.rs +++ b/src/dynimage.rs @@ -1231,7 +1231,7 @@ mod test { fn open_16bpc_png() { let im_path = "./tests/images/png/16bpc/basn6a16.png"; let image = super::open(im_path).unwrap(); - assert_eq!(image.color(), super::color::ColorType::Rgba16); + assert_eq!(image.color(), ColorType::Rgba16); } fn test_grayscale(mut img: super::DynamicImage, alpha_discarded: bool) { diff --git a/src/math/utils.rs b/src/math/utils.rs index 66ff776c39..d734815023 100644 --- a/src/math/utils.rs +++ b/src/math/utils.rs @@ -48,7 +48,7 @@ mod test { // We could check that case separately but it does not conform to the same expectation. if new_w as u64 * 400u64 >= old_w as u64 * u64::from(u32::MAX) { return true; } - let result = super::resize_dimensions(old_w, 400, new_w, ::std::u32::MAX, false); + let result = super::resize_dimensions(old_w, 400, new_w, std::u32::MAX, false); let exact = (400_f64 * new_w as f64 / old_w as f64).round() as u32; result.0 == new_w && result.1 == exact.max(1) } @@ -61,7 +61,7 @@ mod test { // We could check that case separately but it does not conform to the same expectation. if 400u64 * new_h as u64 >= old_h as u64 * u64::from(u32::MAX) { return true; } - let result = super::resize_dimensions(400, old_h, ::std::u32::MAX, new_h, false); + let result = super::resize_dimensions(400, old_h, std::u32::MAX, new_h, false); let exact = (400_f64 * new_h as f64 / old_h as f64).round() as u32; result.1 == new_h && result.0 == exact.max(1) } @@ -87,12 +87,12 @@ mod test { #[test] fn resize_handles_overflow() { - let result = super::resize_dimensions(100, ::std::u32::MAX, 200, ::std::u32::MAX, true); + let result = super::resize_dimensions(100, std::u32::MAX, 200, std::u32::MAX, true); assert!(result.0 == 100); - assert!(result.1 == ::std::u32::MAX); + assert!(result.1 == std::u32::MAX); - let result = super::resize_dimensions(::std::u32::MAX, 100, ::std::u32::MAX, 200, true); - assert!(result.0 == ::std::u32::MAX); + let result = super::resize_dimensions(std::u32::MAX, 100, std::u32::MAX, 200, true); + assert!(result.0 == std::u32::MAX); assert!(result.1 == 100); } diff --git a/src/traits.rs b/src/traits.rs index fba0c4eedf..a993a3350c 100644 --- a/src/traits.rs +++ b/src/traits.rs @@ -171,7 +171,7 @@ impl Lerp for f32 { /// The pixel with an associated `ColorType`. /// Not all possible pixels represent one of the predefined `ColorType`s. -pub trait PixelWithColorType: Pixel + self::private::SealedPixelWithColorType { +pub trait PixelWithColorType: Pixel + private::SealedPixelWithColorType { /// This pixel has the format of one of the predefined `ColorType`s, /// such as `Rgb8`, `La16` or `Rgba32F`. /// This is needed for automatically detecting