Skip to content

Commit

Permalink
feat: 🎨 clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
Tbelleng committed Apr 17, 2024
1 parent 07892aa commit eb60c61
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 2 additions & 4 deletions crates/client/rpc/src/methods/read/get_events.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,17 +137,15 @@ where
///
/// * `(block_events: Vec<EventWrapper>, continuation_token: usize)` - A tuple of the filtered
/// events and the first index which still hasn't been processed block_id and an instance of Block
fn filter_events_by_params<'a>(
fn filter_events_by_params(
events: Vec<EmittedEvent>,
address: Option<Felt252Wrapper>,
keys: &'a [Vec<FieldElement>],
keys: &[Vec<FieldElement>],
) -> Vec<EmittedEvent> {
let mut filtered_events = vec![];

// Iterate on block events.
for event in events {
let match_from_address = address.map_or(true, |addr| addr.0 == event.from_address);
// Based on https://github.com/starkware-libs/papyrus/blob/f81f5ec712b4be75ec7da2fc9f3e46c843cc2327/crates/papyrus_rpc/src/v0_5/api/api_impl.rs#L1495-L1499
let match_keys = keys
.iter()
.enumerate()
Expand Down
2 changes: 1 addition & 1 deletion crates/client/rpc/src/methods/trace/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ where
})?;
let block_number = starknet_block.header().block_number;
let mut previous_block_number = block_number - 1;
if previous_block_number <= 0 {
if previous_block_number == 0 {
previous_block_number = 0;
}
let substrate_block_hash =
Expand Down

0 comments on commit eb60c61

Please sign in to comment.