Skip to content

Commit

Permalink
Satisfy clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
kstepanovdev committed Nov 15, 2024
1 parent a39c1bc commit 0622c99
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 21 deletions.
6 changes: 3 additions & 3 deletions nft_ingester/src/bin/synchronizer/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ pub async fn main() -> Result<(), IngesterError> {
}

let asset_types = [AssetType::Fungible, AssetType::NonFungible];
for asset_type in asset_types.clone().into_iter() {
for asset_type in asset_types.into_iter() {
let synchronizer = synchronizer.clone();
let shutdown_rx = shutdown_rx.resubscribe();

Expand All @@ -150,7 +150,7 @@ pub async fn main() -> Result<(), IngesterError> {
Ok(())
});
}
while let Some(_) = mutexed_tasks.lock().await.join_next().await {}
while (mutexed_tasks.lock().await.join_next().await).is_some() {}

let shutdown_rx_clone = shutdown_rx.resubscribe();
let synchronizer_clone = synchronizer.clone();
Expand Down Expand Up @@ -202,7 +202,7 @@ pub async fn main() -> Result<(), IngesterError> {
Ok(())
});

while let Some(_) = mutexed_tasks.lock().await.join_next().await {}
while (mutexed_tasks.lock().await.join_next().await).is_some() {}

Ok(())
}
22 changes: 4 additions & 18 deletions rocks-db/src/batch_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,15 +89,8 @@ impl AssetUpdateIndexStorage for Storage {
None => self.fungible_assets_update_idx.iter_start(),
};

let up_to = if let Some(up_to_key) = up_to {
Some(encode_u64x2_pubkey(
up_to_key.seq,
up_to_key.slot,
up_to_key.pubkey,
))
} else {
None
};
let up_to = up_to
.map(|up_to_key| encode_u64x2_pubkey(up_to_key.seq, up_to_key.slot, up_to_key.pubkey));

for pair in iterator {
let (idx_key, _) = pair?;
Expand Down Expand Up @@ -156,15 +149,8 @@ impl AssetUpdateIndexStorage for Storage {
None => self.assets_update_idx.iter_start(),
};

let up_to = if let Some(up_to_key) = up_to {
Some(encode_u64x2_pubkey(
up_to_key.seq,
up_to_key.slot,
up_to_key.pubkey,
))
} else {
None
};
let up_to = up_to
.map(|up_to_key| encode_u64x2_pubkey(up_to_key.seq, up_to_key.slot, up_to_key.pubkey));

for pair in iterator {
let (idx_key, _) = pair?;
Expand Down

0 comments on commit 0622c99

Please sign in to comment.