From 95940b299f78c025d248a6d30e9706db7712d4ea Mon Sep 17 00:00:00 2001 From: Jed <4679729+jedleggett@users.noreply.github.com> Date: Fri, 16 Feb 2024 09:49:54 -0600 Subject: [PATCH] fix clippy --- .github/actions/setup-rust/action.yaml | 10 +++++----- .github/workflows/clean_code.yaml | 4 ++-- core/src/ofac.rs | 10 ++++------ 3 files changed, 11 insertions(+), 13 deletions(-) diff --git a/.github/actions/setup-rust/action.yaml b/.github/actions/setup-rust/action.yaml index cabd3f08..d46d7340 100644 --- a/.github/actions/setup-rust/action.yaml +++ b/.github/actions/setup-rust/action.yaml @@ -53,17 +53,17 @@ runs: - name: Update Rust run: | rustup update - rustup install nightly-2024-02-08 - rustup component add rustfmt --toolchain nightly-2024-02-08-x86_64-unknown-linux-gnu - rustup component add clippy --toolchain nightly-2024-02-08-x86_64-unknown-linux-gnu + rustup install nightly-2024-02-01 + rustup component add rustfmt --toolchain nightly-2024-02-01-x86_64-unknown-linux-gnu + rustup component add clippy --toolchain nightly-2024-02-01-x86_64-unknown-linux-gnu shell: bash - name: Check rust version after run: | rustc --version; cargo --version; - cargo +nightly-2024-02-08-x86_64-unknown-linux-gnu clippy --version; - cargo +nightly-2024-02-08-x86_64-unknown-linux-gnu fmt --version; + cargo +nightly-2024-02-01-x86_64-unknown-linux-gnu clippy --version; + cargo +nightly-2024-02-01-x86_64-unknown-linux-gnu fmt --version; shell: bash - name: Install Cargo Deps diff --git a/.github/workflows/clean_code.yaml b/.github/workflows/clean_code.yaml index 3d7f8382..07303382 100644 --- a/.github/workflows/clean_code.yaml +++ b/.github/workflows/clean_code.yaml @@ -16,7 +16,7 @@ jobs: caller-workflow-name: clippy_and_udeps_check - name: cargo clippy - run: cargo +nightly-2024-02-08-x86_64-unknown-linux-gnu clippy --all-targets + run: cargo +nightly-2024-02-01-x86_64-unknown-linux-gnu clippy --all-targets - name: cargo udeps - run: cargo +nightly-2024-02-08-x86_64-unknown-linux-gnu udeps --locked + run: cargo +nightly-2024-02-01-x86_64-unknown-linux-gnu udeps --locked diff --git a/core/src/ofac.rs b/core/src/ofac.rs index 92fcded3..337da02c 100644 --- a/core/src/ofac.rs +++ b/core/src/ofac.rs @@ -55,11 +55,9 @@ fn is_ofac_address_in_lookup_table( #[cfg(test)] mod tests { - use std::{collections::HashSet, sync::Arc, time::Duration}; + use std::collections::HashSet; - use crossbeam_channel::unbounded; use dashmap::DashMap; - use solana_perf::packet::PacketBatch; use solana_sdk::{ address_lookup_table_account::AddressLookupTableAccount, hash::Hash, @@ -167,7 +165,7 @@ mod tests { let lookup_table_pubkey = Pubkey::new_unique(); let lookup_table = AddressLookupTableAccount { - key: lookup_table_pubkey.clone(), + key: lookup_table_pubkey, addresses: vec![ofac_pubkey, Pubkey::new_unique()], }; @@ -281,7 +279,7 @@ mod tests { Hash::default(), ); let random_tx = VersionedTransaction::from(random_tx); - let random_packet = Packet::from_data(None, &random_tx).expect("can create packet"); + let random_packet = Packet::from_data(None, random_tx).expect("can create packet"); let ofac_tx = Transaction::new_signed_with_payer( &[Instruction::new_with_bytes( @@ -298,7 +296,7 @@ mod tests { Hash::default(), ); let ofac_tx = VersionedTransaction::from(ofac_tx); - let ofac_packet = Packet::from_data(None, &ofac_tx).expect("can create packet"); + let ofac_packet = Packet::from_data(None, ofac_tx).expect("can create packet"); assert!(!is_tx_ofac_related( &random_packet.deserialize_slice(..).unwrap(),