From 72e376d74cff4dba41464cbf3478d352eb4170ac Mon Sep 17 00:00:00 2001 From: David Skrundz Date: Fri, 4 Apr 2025 01:16:31 -0600 Subject: [PATCH] Epand lints --- Cargo.toml | 15 +++++++++++++++ rust/src/lib.rs | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 75126d2..d27bbba 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,12 +9,27 @@ license-file = "LICENSE.md" rust-version = "1.85.0" [workspace.lints.rust] +arithmetic_overflow = "forbid" unsafe_code = "forbid" +[workspace.lints.clippy] +arithmetic_side_effects = "forbid" +as_conversions = "forbid" +checked_conversions = "forbid" +default_union_representation = "forbid" +expect_used = "forbid" +indexing_slicing = "forbid" +integer_division = "forbid" +integer_division_remainder_used = "forbid" +transmute_undefined_repr = "forbid" +unchecked_duration_subtraction = "forbid" +unwrap_used = "forbid" + [profile.release] codegen-units = 1 lto = "fat" opt-level = 3 +overflow-checks = true strip = "debuginfo" [workspace.dependencies] diff --git a/rust/src/lib.rs b/rust/src/lib.rs index 06d268d..d548138 100644 --- a/rust/src/lib.rs +++ b/rust/src/lib.rs @@ -1,5 +1,5 @@ pub fn add(left: usize, right: usize) -> usize { - left + right + left.wrapping_add(right) } #[cfg(test)]