Skip to content

Commit

Permalink
Remove most clippy linting exceptions (#617)
Browse files Browse the repository at this point in the history
  • Loading branch information
theotherphil authored May 19, 2024
1 parent eae02a4 commit f210a9a
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 24 deletions.
11 changes: 2 additions & 9 deletions src/corners.rs
Original file line number Diff line number Diff line change
Expand Up @@ -318,15 +318,8 @@ fn is_corner_fast9(image: &GrayImage, threshold: u8, x: u32, y: u32) -> bool {
)
};

let above = (p0 > high_thresh && p4 > high_thresh)
|| (p4 > high_thresh && p8 > high_thresh)
|| (p8 > high_thresh && p12 > high_thresh)
|| (p12 > high_thresh && p0 > high_thresh);

let below = (p0 < low_thresh && p4 < low_thresh)
|| (p4 < low_thresh && p8 < low_thresh)
|| (p8 < low_thresh && p12 < low_thresh)
|| (p12 < low_thresh && p0 < low_thresh);
let above = (p12 > high_thresh || p4 > high_thresh) && (p8 > high_thresh || p0 > high_thresh);
let below = (p12 < low_thresh || p4 < low_thresh) && (p8 < low_thresh || p0 < low_thresh);

if !above && !below {
return false;
Expand Down
15 changes: 1 addition & 14 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,7 @@
#![deny(missing_docs)]
#![cfg_attr(test, feature(test))]
#![cfg_attr(docsrs, feature(doc_cfg))]
#![allow(
clippy::cast_lossless,
clippy::too_many_arguments,
clippy::needless_range_loop,
clippy::useless_let_if_seq,
clippy::match_wild_err_arm,
clippy::needless_doctest_main,
clippy::range_plus_one,
clippy::trivially_copy_pass_by_ref,
clippy::nonminimal_bool,
clippy::expect_fun_call,
clippy::many_single_char_names,
clippy::zero_prefixed_literal
)]
#![allow(clippy::zero_prefixed_literal, clippy::needless_range_loop)]

#[cfg(test)]
extern crate test;
Expand Down
1 change: 1 addition & 0 deletions src/suppress.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ where
/// Returns true if the given block contains a larger value than
/// the input, or contains an equal value with lexicographically
/// lesser coordinates.
#[allow(clippy::too_many_arguments)]
fn contains_greater_value<I, C>(
image: &I,
x: u32,
Expand Down
2 changes: 1 addition & 1 deletion src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -650,7 +650,7 @@ fn colored(s: &str, c: Color) -> String {

/// Loads image at given path, panicking on failure.
pub fn load_image_or_panic<P: AsRef<Path> + fmt::Debug>(path: P) -> DynamicImage {
open(path.as_ref()).expect(&format!("Could not load image at {:?}", path.as_ref()))
open(path.as_ref()).unwrap_or_else(|_| panic!("Could not load image at {:?}", path.as_ref()))
}

/// Gray image to use in benchmarks. This is neither noise nor
Expand Down

0 comments on commit f210a9a

Please sign in to comment.