From 0a1a108c0b963065da6b606e8d5ea4c89b0f0c85 Mon Sep 17 00:00:00 2001 From: Kasper Date: Fri, 30 May 2025 00:23:51 +0200 Subject: [PATCH] Fix clippy --- Cargo.toml | 6 ++++++ src/evaluator.rs | 3 +-- src/lib.rs | 8 -------- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index dcb8bc7..c376056 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -27,3 +27,9 @@ unicode-segmentation = "1.10" [dev-dependencies] regex = "1.7" + +[lints.clippy] +comparison_chain = "allow" +if_same_then_else = "allow" +match_like_matches_macro = "allow" +get_first = "allow" diff --git a/src/evaluator.rs b/src/evaluator.rs index e006ed3..bfd88d6 100644 --- a/src/evaluator.rs +++ b/src/evaluator.rs @@ -89,8 +89,7 @@ pub fn sin(mut input: d128) -> d128 { let unrounded_result = negative_correction * result; // This uses bankers rounding, but I *think* it's fine - let result = unrounded_result.quantize(rounding_base()); - result + unrounded_result.quantize(rounding_base()) } /// Returns the cosine of a [`struct@d128`] diff --git a/src/lib.rs b/src/lib.rs index 70e4858..b117b67 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,11 +1,3 @@ -#![cfg_attr( - feature = "cargo-clippy", - allow( - clippy::comparison_chain, - clippy::if_same_then_else, - clippy::match_like_matches_macro, - ) -)] //! calculation + conversion //! //! cpc parses and evaluates strings of math, with support for units and conversion. 128-bit decimal floating points are used for high accuracy.