Skip to content

Commit

Permalink
fix clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
jedleggett committed Feb 16, 2024
1 parent aeda4e1 commit 95940b2
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 13 deletions.
10 changes: 5 additions & 5 deletions .github/actions/setup-rust/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/clean_code.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
10 changes: 4 additions & 6 deletions core/src/ofac.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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()],
};

Expand Down Expand Up @@ -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(
Expand All @@ -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(),
Expand Down

0 comments on commit 95940b2

Please sign in to comment.