Skip to content

Commit 8cfad38

Browse files
LeoPatOZ0xNeshi
authored andcommitted
fix: clippy by allowing _ binding
1 parent a5b9189 commit 8cfad38

File tree

6 files changed

+21
-3
lines changed

6 files changed

+21
-3
lines changed

src/block_range_scanner.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,7 @@ impl<N: Network> Service<N> {
294294
tokio::select! {
295295
cmd = self.command_receiver.recv() => {
296296
if let Some(command) = cmd {
297+
#[allow(clippy::used_underscore_binding)]
297298
if let Err(_e) = self.handle_command(command).await {
298299
opt_error!("Command handling error: {}", _e);
299300
self.error_count += 1;

src/block_range_scanner/reorg_handler.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ impl<N: Network> ReorgHandler<N> {
9797

9898
let finalized = self.provider.get_block_by_number(BlockNumberOrTag::Finalized).await?;
9999

100+
#[allow(clippy::used_underscore_binding)]
100101
let _header = finalized.header();
101102
opt_info!(finalized_hash = %_header.hash(), block_number = _header.number(), "Finalized block set as common ancestor");
102103

src/event_scanner/scanner/common.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ pub(crate) async fn handle_stream<N: Network, S: Stream<Item = BlockScannerResul
7676
};
7777

7878
while let Some(message) = stream.next().await {
79+
#[allow(clippy::used_underscore_binding)]
7980
if let Err(_err) = range_tx.send(message) {
8081
opt_warn!(error = %_err, "No log consumers, stopping stream");
8182
break;
@@ -153,6 +154,7 @@ fn spawn_log_consumers_in_stream_mode<N: Network>(
153154
opt_debug!("No more block ranges to receive");
154155
break;
155156
}
157+
#[allow(clippy::used_underscore_binding)]
156158
Err(RecvError::Lagged(_skipped)) => {
157159
opt_debug!("Channel lagged, skipped {_skipped} messages");
158160
}
@@ -299,6 +301,7 @@ fn spawn_log_consumers_in_collection_mode<N: Network>(
299301
opt_debug!("No more block ranges to receive");
300302
break;
301303
}
304+
#[allow(clippy::used_underscore_binding)]
302305
Err(RecvError::Lagged(_skipped)) => {
303306
opt_debug!("Channel lagged, skipped {_skipped} messages");
304307
}
@@ -368,6 +371,7 @@ fn collect_logs<T>(collected: &mut Vec<T>, logs: Vec<T>, count: usize, prepend:
368371
collected.len() >= count
369372
}
370373

374+
#[allow(clippy::used_underscore_binding)]
371375
async fn get_logs<N: Network>(
372376
range: RangeInclusive<u64>,
373377
_event_filter: &EventFilter,

src/robust_provider/provider.rs

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ impl<N: Network> RobustProvider<N> {
121121
false,
122122
)
123123
.await;
124+
#[allow(clippy::used_underscore_binding)]
124125
if let Err(_e) = &result {
125126
opt_error!(error = %_e, "eth_getByBlockNumber failed");
126127
}
@@ -143,6 +144,7 @@ impl<N: Network> RobustProvider<N> {
143144
false,
144145
)
145146
.await;
147+
#[allow(clippy::used_underscore_binding)]
146148
if let Err(_e) = &result {
147149
opt_error!(error = %_e, "eth_getByBlockNumber failed");
148150
}
@@ -165,6 +167,7 @@ impl<N: Network> RobustProvider<N> {
165167
)
166168
.await
167169
.map_err(Error::from);
170+
#[allow(clippy::used_underscore_binding)]
168171
if let Err(_e) = &result {
169172
opt_error!(error = %_e, "eth_getBlockNumber failed");
170173
}
@@ -190,6 +193,7 @@ impl<N: Network> RobustProvider<N> {
190193
false,
191194
)
192195
.await;
196+
#[allow(clippy::used_underscore_binding)]
193197
if let Err(_e) = &result {
194198
opt_error!(error = %_e, "get_block_number_by_id failed");
195199
}
@@ -231,6 +235,7 @@ impl<N: Network> RobustProvider<N> {
231235
false,
232236
)
233237
.await;
238+
#[allow(clippy::used_underscore_binding)]
234239
if let Err(_e) = &result {
235240
opt_error!(error = %_e, "eth_getBlockByHash failed");
236241
}
@@ -254,6 +259,7 @@ impl<N: Network> RobustProvider<N> {
254259
)
255260
.await
256261
.map_err(Error::from);
262+
#[allow(clippy::used_underscore_binding)]
257263
if let Err(_e) = &result {
258264
opt_error!(error = %_e, "eth_getLogs failed");
259265
}
@@ -414,9 +420,12 @@ impl<N: Network> RobustProvider<N> {
414420
self.call_timeout,
415421
(|| operation(provider.clone()))
416422
.retry(retry_strategy)
417-
.notify(|_err: &RpcError<TransportErrorKind>, _dur: Duration| {
418-
opt_info!(error = %_err, "RPC error retrying after {:?}", _dur);
419-
})
423+
.notify(
424+
#[allow(clippy::used_underscore_binding)]
425+
|_err: &RpcError<TransportErrorKind>, _dur: Duration| {
426+
opt_info!(error = %_err, "RPC error retrying after {:?}", _dur);
427+
},
428+
)
420429
.sleep(tokio::time::sleep),
421430
)
422431
.await

src/robust_provider/subscription.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ impl<N: Network> RobustSubscription<N> {
128128
RecvError::Closed => {
129129
opt_error!("Provider closed the subscription channel");
130130
}
131+
#[allow(clippy::used_underscore_binding)]
131132
RecvError::Lagged(_count) => {
132133
opt_error!(skipped = _count, "Receiver lagged");
133134
}
@@ -180,6 +181,7 @@ impl<N: Network> RobustSubscription<N> {
180181
self.last_reconnect_attempt = None;
181182
true
182183
}
184+
#[allow(clippy::used_underscore_binding)]
183185
Err(_e) => {
184186
self.last_reconnect_attempt = Some(Instant::now());
185187
opt_warn!(error = %_e, "Failed to reconnect to primary provider");

src/types.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ pub(crate) trait TryStream<T: Clone> {
106106
async fn try_stream<M: IntoScannerResult<T>>(&self, msg: M) -> bool;
107107
}
108108

109+
#[allow(clippy::used_underscore_binding)]
109110
impl<T: Clone + Debug> TryStream<T> for mpsc::Sender<ScannerResult<T>> {
110111
async fn try_stream<M: IntoScannerResult<T>>(&self, msg: M) -> bool {
111112
let item = msg.into_scanner_message_result();

0 commit comments

Comments
 (0)