From 450f4460325c367c7acc10ccfa4a38500ecd60bb Mon Sep 17 00:00:00 2001 From: Christian Kamm Date: Tue, 9 May 2023 21:08:55 +0200 Subject: [PATCH] Make clippy happy (#580) --- .github/workflows/ci-code-review-rust.yml | 2 +- programs/mango-v4/src/instructions/benchmark.rs | 6 ------ rust-toolchain.toml | 1 + 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci-code-review-rust.yml b/.github/workflows/ci-code-review-rust.yml index 28bcb51c3..078ffe693 100644 --- a/.github/workflows/ci-code-review-rust.yml +++ b/.github/workflows/ci-code-review-rust.yml @@ -70,7 +70,7 @@ jobs: - name: Run clippy # The --allow args are due to clippy scanning anchor - run: cargo clippy --no-deps -- --deny=warnings --allow=clippy::style --allow=clippy::complexity --allow=clippy::manual-retain --allow=clippy::crate-in-macro-def --allow=clippy::result-large-err --allow=clippy::derive_partial_eq_without_eq + run: cargo clippy --workspace --exclude anchor-\* --exclude fixed --exclude checked_math --features enable-gpl -- --no-deps --deny=warnings --allow=clippy::style --allow=clippy::complexity --allow=clippy::manual-retain --allow=clippy::crate-in-macro-def --allow=clippy::result-large-err --allow=clippy::derive_partial_eq_without_eq test: name: Test diff --git a/programs/mango-v4/src/instructions/benchmark.rs b/programs/mango-v4/src/instructions/benchmark.rs index 99d24b9d3..5705d710f 100644 --- a/programs/mango-v4/src/instructions/benchmark.rs +++ b/programs/mango-v4/src/instructions/benchmark.rs @@ -187,9 +187,6 @@ pub fn benchmark(_ctx: Context) -> Result<()> { let _ = half + half; // 0 sol_log_compute_units(); // 92509 - let _ = max - max; // 0 - sol_log_compute_units(); // 92408 - let _ = large_number * large_number; // 77 sol_log_compute_units(); // 92230 @@ -200,8 +197,5 @@ pub fn benchmark(_ctx: Context) -> Result<()> { let _ = half / max; // 3438 sol_log_compute_units(); // 87751 - let _ = max / max; // 3457 - sol_log_compute_units(); // 84193 - Ok(()) } diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 4842915c4..c6549df5b 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,2 +1,3 @@ [toolchain] channel = "1.65" +components = ["rustfmt", "clippy"]