Skip to content

Commit

Permalink
More clippy changes
Browse files Browse the repository at this point in the history
  • Loading branch information
godmodegalactus committed Jan 12, 2024
1 parent 1acc71d commit 78e1bb2
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 18 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/clippy_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
# use toolchain version from rust-toolchain.toml
toolchain: nightly
toolchain: +nightly-2024-01-05
components: rustfmt, clippy
cache: true
# avoid the default "-D warnings" which thrashes cache
Expand All @@ -48,5 +48,5 @@ jobs:

- name: Run fmt+clippy
run: |
cargo +nightly fmt --all --check
cargo +nightly clippy --locked --workspace --all-targets -- -D warnings
cargo +nightly-2024-01-05 fmt --all --check
cargo +nightly-2024-01-05 clippy --locked --workspace --all-targets -- -D warnings
16 changes: 4 additions & 12 deletions cluster-endpoints/src/grpc_subscription.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,21 +47,13 @@ pub fn map_block_update(
.transactions
.into_iter()
.filter_map(|tx| {
let Some(meta) = tx.meta else {
return None;
};
let meta = tx.meta?;

let Some(transaction) = tx.transaction else {
return None;
};
let transaction = tx.transaction?;

let Some(message) = transaction.message else {
return None;
};
let message = transaction.message?;

let Some(header) = message.header else {
return None;
};
let header = message.header?;

let signatures = transaction
.signatures
Expand Down
4 changes: 1 addition & 3 deletions core/src/stores/block_information_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,7 @@ impl BlockInformationStore {
}

pub fn get_block_info(&self, blockhash: &str) -> Option<BlockInformation> {
let Some(info) = self.blocks.get(blockhash) else {
return None;
};
let info = self.blocks.get(blockhash)?;

Some(info.value().to_owned())
}
Expand Down
2 changes: 2 additions & 0 deletions run_clippy_fmt.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
cargo +nightly-2024-01-05 fmt --all
cargo +nightly-2024-01-05 clippy --locked --workspace --all-targets -- -D warnings

0 comments on commit 78e1bb2

Please sign in to comment.