chore: allow clippy false positive (#2259)

otherwise filter wont live long enough
This commit is contained in:
Georgios Konstantopoulos 2023-03-13 14:00:44 -07:00 committed by GitHub
parent 6ba8dd72e7
commit 8c5c248491
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -84,6 +84,7 @@ where
// if not paginatable, load logs and consume // if not paginatable, load logs and consume
let filter = self.filter.clone(); let filter = self.filter.clone();
let provider = self.provider; let provider = self.provider;
#[allow(clippy::redundant_async_block)]
let fut = Box::pin(async move { provider.get_logs(&filter).await }); let fut = Box::pin(async move { provider.get_logs(&filter).await });
rewake_with_new_state!(ctx, self, LogQueryState::LoadLogs(fut)); rewake_with_new_state!(ctx, self, LogQueryState::LoadLogs(fut));
} else { } else {
@ -106,6 +107,7 @@ where
let filter = self.filter.clone().from_block(from_block).to_block(to_block); let filter = self.filter.clone().from_block(from_block).to_block(to_block);
let provider = self.provider; let provider = self.provider;
// load first page of logs // load first page of logs
#[allow(clippy::redundant_async_block)]
let fut = Box::pin(async move { provider.get_logs(&filter).await }); let fut = Box::pin(async move { provider.get_logs(&filter).await });
rewake_with_new_state!(ctx, self, LogQueryState::LoadLogs(fut)); rewake_with_new_state!(ctx, self, LogQueryState::LoadLogs(fut));
} }
@ -134,13 +136,14 @@ where
// no more pages to load, and everything is consumed // no more pages to load, and everything is consumed
// can safely assume this will always be set in this state // can safely assume this will always be set in this state
if from_block > self.last_block.unwrap() { if from_block > self.last_block.unwrap() {
return Poll::Ready(None) return Poll::Ready(None);
} }
// load next page // load next page
self.from_block = Some(to_block + 1); self.from_block = Some(to_block + 1);
let filter = self.filter.clone().from_block(from_block).to_block(to_block); let filter = self.filter.clone().from_block(from_block).to_block(to_block);
let provider = self.provider; let provider = self.provider;
#[allow(clippy::redundant_async_block)]
let fut = Box::pin(async move { provider.get_logs(&filter).await }); let fut = Box::pin(async move { provider.get_logs(&filter).await });
rewake_with_new_state!(ctx, self, LogQueryState::LoadLogs(fut)); rewake_with_new_state!(ctx, self, LogQueryState::LoadLogs(fut));
} }