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

Remove allow(unused_imports) #589

Merged
merged 3 commits into from
May 5, 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
3 changes: 0 additions & 3 deletions src/binary_descriptors/brief.rs
Original file line number Diff line number Diff line change
Expand Up @@ -270,9 +270,6 @@ pub fn brief(
#[cfg(test)]
mod tests {
use super::*;
use crate::utils::gray_bench_image;
use rand::Rng;
use test::{black_box, Bencher};

#[test]
fn test_compute_hamming_distance() {
Expand Down
2 changes: 0 additions & 2 deletions src/contrast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,6 @@ fn histogram_lut(source_histc: &[u32; 256], target_histc: &[u32; 256]) -> [usize
mod tests {
use super::*;
use crate::definitions::{HasBlack, HasWhite};
use crate::utils::gray_bench_image;
use image::{GrayImage, Luma};

#[test]
Expand Down Expand Up @@ -583,7 +582,6 @@ mod tests {
#[cfg(test)]
mod benches {
use super::*;
use crate::definitions::{HasBlack, HasWhite};
use crate::utils::gray_bench_image;
use image::{GrayImage, Luma};
use test::{black_box, Bencher};
Expand Down
3 changes: 1 addition & 2 deletions src/drawing/conics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ where
#[cfg(test)]
mod tests {
use super::draw_filled_ellipse_mut;
use image::{GenericImage, GrayImage, Luma};
use image::GenericImage;

struct Ellipse {
center: (i32, i32),
Expand Down Expand Up @@ -382,7 +382,6 @@ mod tests {
#[cfg(not(miri))]
#[cfg(test)]
mod benches {
use super::*;
use image::{GrayImage, Luma};

macro_rules! bench_hollow_ellipse {
Expand Down
1 change: 0 additions & 1 deletion src/drawing/line.rs
Original file line number Diff line number Diff line change
Expand Up @@ -596,7 +596,6 @@ mod tests {
#[cfg(not(miri))]
#[cfg(test)]
mod benches {
use super::*;
use image::{GrayImage, Luma};

macro_rules! bench_antialiased_lines {
Expand Down
5 changes: 2 additions & 3 deletions src/drawing/rect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ mod tests {
use super::*;
use crate::drawing::Blend;
use crate::rect::Rect;
use image::{GrayImage, Luma, Pixel, Rgb, RgbImage, Rgba, RgbaImage};
use image::{GrayImage, Luma, Pixel, Rgba, RgbaImage};

#[test]
fn test_draw_hollow_rect() {
Expand Down Expand Up @@ -149,9 +149,8 @@ mod tests {
#[cfg(test)]
mod benches {
use super::*;
use crate::drawing::Blend;
use crate::rect::Rect;
use image::{GrayImage, Luma, Pixel, Rgb, RgbImage, Rgba, RgbaImage};
use image::{Rgb, RgbImage};
use test::{black_box, Bencher};

#[bench]
Expand Down
12 changes: 5 additions & 7 deletions src/filter/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -570,11 +570,10 @@ pub fn laplacian_filter(image: &GrayImage) -> Image<Luma<i16>> {
mod tests {
use super::*;
use crate::definitions::{Clamp, Image};
use crate::utils::{gray_bench_image, rgb_bench_image};
use image::imageops::blur;
use image::{GenericImage, GrayImage, ImageBuffer, Luma, Rgb};
use crate::utils::gray_bench_image;
use image::{GrayImage, ImageBuffer, Luma};
use std::cmp::{max, min};
use test::{black_box, Bencher};
use test::black_box;

#[test]
fn test_bilateral_filter() {
Expand Down Expand Up @@ -929,11 +928,10 @@ mod tests {
#[cfg(test)]
mod benches {
use super::*;
use crate::definitions::{Clamp, Image};
use crate::definitions::Image;
use crate::utils::{gray_bench_image, rgb_bench_image};
use image::imageops::blur;
use image::{GenericImage, GrayImage, ImageBuffer, Luma, Rgb};
use std::cmp::{max, min};
use image::{GenericImage, ImageBuffer, Luma, Rgb};
use test::{black_box, Bencher};

#[bench]
Expand Down
3 changes: 1 addition & 2 deletions src/geometric_transformations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -742,8 +742,7 @@ pub enum Interpolation {
#[cfg(test)]
mod tests {
use super::*;
use crate::utils::gray_bench_image;
use image::{GrayImage, Luma};
use image::Luma;

#[test]
fn test_rotate_nearest_zero_radians() {
Expand Down
1 change: 0 additions & 1 deletion src/gradients.rs
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,6 @@ fn gradient_magnitude(dx: f32, dy: f32) -> u16 {
#[cfg(test)]
mod tests {
use super::*;
use crate::utils::gray_bench_image;
use image::{ImageBuffer, Luma};

#[rustfmt::skip::macros(gray_image)]
Expand Down
2 changes: 0 additions & 2 deletions src/haar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,6 @@ mod tests {
use super::*;
use crate::integral_image::{integral_image, sum_image_pixels};
use crate::utils::gray_bench_image;
use ::test;

#[test]
fn test_block_sizes() {
Expand Down Expand Up @@ -741,7 +740,6 @@ mod tests {
mod benches {
use super::*;
use crate::{integral_image::integral_image, utils::gray_bench_image};
use test::Bencher;

#[bench]
fn bench_evaluate_all_features_10x10(b: &mut test::Bencher) {
Expand Down
1 change: 0 additions & 1 deletion src/hog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,6 @@ fn data_length(lengths: [usize; 3]) -> usize {
#[cfg(test)]
mod tests {
use super::*;
use crate::utils::gray_bench_image;
use ::test;

#[test]
Expand Down
2 changes: 1 addition & 1 deletion src/hough.rs
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ fn intersection_points(
#[cfg(test)]
mod tests {
use super::*;
use image::{GrayImage, ImageBuffer, Luma};
use image::{GrayImage, Luma};

fn assert_points_eq(
actual: Option<((f32, f32), (f32, f32))>,
Expand Down
4 changes: 2 additions & 2 deletions src/integral_image.rs
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@ mod tests {
use super::*;
use crate::definitions::Image;
use crate::property_testing::GrayTestImage;
use crate::utils::{gray_bench_image, pixel_diff_summary, rgb_bench_image};
use crate::utils::pixel_diff_summary;
use image::{GenericImage, ImageBuffer, Luma};
use quickcheck::{quickcheck, TestResult};

Expand Down Expand Up @@ -598,7 +598,7 @@ mod tests {
#[cfg(test)]
mod benches {
use super::*;
use crate::utils::{gray_bench_image, pixel_diff_summary, rgb_bench_image};
use crate::utils::{gray_bench_image, rgb_bench_image};
use ::test;

#[bench]
Expand Down
3 changes: 1 addition & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@
clippy::nonminimal_bool,
clippy::expect_fun_call,
clippy::many_single_char_names,
clippy::zero_prefixed_literal,
unused_imports
clippy::zero_prefixed_literal
)]

#[cfg(test)]
Expand Down
1 change: 0 additions & 1 deletion src/local_binary_patterns.rs
Original file line number Diff line number Diff line change
Expand Up @@ -650,7 +650,6 @@ pub static MIN_SHIFT: [u8; 256] = [
#[cfg(test)]
mod tests {
use super::*;
use image::{GrayImage, Luma};

#[test]
fn test_uniform_representative_2() {
Expand Down
2 changes: 0 additions & 2 deletions src/morphology.rs
Original file line number Diff line number Diff line change
Expand Up @@ -355,8 +355,6 @@ pub fn close_mut(image: &mut GrayImage, norm: Norm, k: u8) {
#[cfg(test)]
mod tests {
use super::*;
use image::{GrayImage, Luma};
use std::cmp::{max, min};

#[test]
fn test_dilate_point_l1_0() {
Expand Down
6 changes: 2 additions & 4 deletions src/region_labelling.rs
Original file line number Diff line number Diff line change
Expand Up @@ -247,8 +247,6 @@ where
mod tests {
extern crate wasm_bindgen_test;

use ::test;

use image::{GrayImage, ImageBuffer, Luma};
#[cfg(target_arch = "wasm32")]
use wasm_bindgen_test::*;
Expand Down Expand Up @@ -314,9 +312,9 @@ mod benches {
use super::connected_components;
use super::tests::chessboard;
use super::Connectivity::{Eight, Four};
use crate::definitions::{HasBlack, HasWhite};
use crate::definitions::HasBlack;
use ::test;
use image::{GrayImage, ImageBuffer, Luma};
use image::Luma;

#[bench]
fn bench_connected_components_eight_chessboard(b: &mut test::Bencher) {
Expand Down
1 change: 0 additions & 1 deletion src/stats.rs
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,6 @@ where
#[cfg(test)]
mod tests {
use super::*;
use image::{GrayImage, Luma, Rgb, RgbImage};

#[test]
fn test_range() {
Expand Down
3 changes: 1 addition & 2 deletions src/suppress.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,6 @@ where
mod tests {
use super::{local_maxima, suppress_non_maximum};
use crate::definitions::{Position, Score};
use crate::noise::gaussian_noise_mut;
use crate::property_testing::GrayTestImage;
use crate::utils::pixel_diff_summary;
use image::{GenericImage, GrayImage, ImageBuffer, Luma, Primitive};
Expand Down Expand Up @@ -346,7 +345,7 @@ mod tests {
mod benches {
use super::{local_maxima, suppress_non_maximum, tests::T};
use crate::noise::gaussian_noise_mut;
use image::{GenericImage, GrayImage, ImageBuffer, Luma, Primitive};
use image::{GrayImage, ImageBuffer, Luma};
use test::Bencher;

#[bench]
Expand Down
2 changes: 0 additions & 2 deletions src/template_matching.rs
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,6 @@ where
#[cfg(test)]
mod tests {
use super::*;
use crate::utils::gray_bench_image;
use image::GrayImage;

#[test]
Expand Down Expand Up @@ -440,7 +439,6 @@ mod tests {
mod benches {
use super::*;
use crate::utils::gray_bench_image;
use image::GrayImage;
use test::{black_box, Bencher};

macro_rules! bench_match_template {
Expand Down
4 changes: 0 additions & 4 deletions src/union_find.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,6 @@ impl DisjointSetForest {
#[cfg(test)]
mod tests {
use super::DisjointSetForest;
use ::test;
use rand::{rngs::StdRng, SeedableRng};
use rand_distr::{Distribution, Uniform};

#[test]
fn test_trees() {
Expand Down Expand Up @@ -185,7 +182,6 @@ mod benches {
use super::*;
use rand::{rngs::StdRng, SeedableRng};
use rand_distr::{Distribution, Uniform};
use test::Bencher;

#[bench]
fn bench_disjoint_set_forest(b: &mut test::Bencher) {
Expand Down
Loading