diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index afd16a3..57440f6 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -17,8 +17,8 @@ jobs: uses: actions/checkout@v2 - name: Build and test with Rust latest run: | - cargo build --verbose - cargo test --verbose + cargo build --verbose --features strict + cargo test --verbose --features strict rust-nightly: runs-on: ubuntu-latest @@ -28,5 +28,5 @@ jobs: uses: actions/checkout@v2 - name: Build and test with Rust nightly run: | - cargo build --verbose - cargo test --verbose + cargo build --verbose --features strict + cargo test --verbose --features strict \ No newline at end of file diff --git a/Cargo.toml b/Cargo.toml index 48dc78f..a533e21 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -18,4 +18,7 @@ jupiter = { git = "https://github.com/jup-ag/rust-amm-implementation.git", branc invariant-types = { git = "https://github.com/invariant-labs/protocol.git", branch = "master" } anchor-lang = "0.26.0" borsh = {version = "*", features = ["const-generics"]} -rust_decimal = "1.30.0" \ No newline at end of file +rust_decimal = "1.30.0" + +[features] +strict = [] \ No newline at end of file diff --git a/src/lib.rs b/src/lib.rs index 738bf5e..0f07ac5 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,3 +1,5 @@ +#![cfg_attr(feature = "strict", deny(unused_results))] + use std::collections::HashMap; use anchor_lang::prelude::*; diff --git a/src/utiles.rs b/src/utiles.rs index 61581b5..298e69e 100644 --- a/src/utiles.rs +++ b/src/utiles.rs @@ -38,7 +38,7 @@ impl JupiterInvariant { .enumerate() .fold(HashMap::new(), |mut m, (index, account)| { if let Some(account) = account { - m.insert(accounts_to_update[index], account.data.clone()); + let _ = m.insert(accounts_to_update[index], account.data.clone()); } m })