Skip to content

Commit 40fbaf8

Browse files
committed
fix: clippy by allowing _ binding
1 parent e92b7af commit 40fbaf8

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
@@ -269,6 +269,7 @@ impl<N: Network> Service<N> {
269269
tokio::select! {
270270
cmd = self.command_receiver.recv() => {
271271
if let Some(command) = cmd {
272+
#[allow(clippy::used_underscore_binding)]
272273
if let Err(_e) = self.handle_command(command).await {
273274
opt_error!("Command handling error: {}", _e);
274275
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
@@ -75,6 +75,7 @@ pub(crate) async fn handle_stream<N: Network, S: Stream<Item = BlockScannerResul
7575
};
7676

7777
while let Some(message) = stream.next().await {
78+
#[allow(clippy::used_underscore_binding)]
7879
if let Err(_err) = range_tx.send(message) {
7980
opt_warn!(error = %_err, "No log consumers, stopping stream");
8081
break;
@@ -152,6 +153,7 @@ fn spawn_log_consumers_in_stream_mode<N: Network>(
152153
opt_debug!("No more block ranges to receive");
153154
break;
154155
}
156+
#[allow(clippy::used_underscore_binding)]
155157
Err(RecvError::Lagged(_skipped)) => {
156158
opt_debug!("Channel lagged, skipped {_skipped} messages");
157159
}
@@ -298,6 +300,7 @@ fn spawn_log_consumers_in_collection_mode<N: Network>(
298300
opt_debug!("No more block ranges to receive");
299301
break;
300302
}
303+
#[allow(clippy::used_underscore_binding)]
301304
Err(RecvError::Lagged(_skipped)) => {
302305
opt_debug!("Channel lagged, skipped {_skipped} messages");
303306
}
@@ -367,6 +370,7 @@ fn collect_logs<T>(collected: &mut Vec<T>, logs: Vec<T>, count: usize, prepend:
367370
collected.len() >= count
368371
}
369372

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

src/robust_provider/provider.rs

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ impl<N: Network> RobustProvider<N> {
122122
false,
123123
)
124124
.await;
125+
#[allow(clippy::used_underscore_binding)]
125126
if let Err(_e) = &result {
126127
opt_error!(error = %_e, "eth_getByBlockNumber failed");
127128
}
@@ -144,6 +145,7 @@ impl<N: Network> RobustProvider<N> {
144145
false,
145146
)
146147
.await;
148+
#[allow(clippy::used_underscore_binding)]
147149
if let Err(_e) = &result {
148150
opt_error!(error = %_e, "eth_getByBlockNumber failed");
149151
}
@@ -166,6 +168,7 @@ impl<N: Network> RobustProvider<N> {
166168
)
167169
.await
168170
.map_err(Error::from);
171+
#[allow(clippy::used_underscore_binding)]
169172
if let Err(_e) = &result {
170173
opt_error!(error = %_e, "eth_getBlockNumber failed");
171174
}
@@ -191,6 +194,7 @@ impl<N: Network> RobustProvider<N> {
191194
false,
192195
)
193196
.await;
197+
#[allow(clippy::used_underscore_binding)]
194198
if let Err(_e) = &result {
195199
opt_error!(error = %_e, "get_block_number_by_id failed");
196200
}
@@ -232,6 +236,7 @@ impl<N: Network> RobustProvider<N> {
232236
false,
233237
)
234238
.await;
239+
#[allow(clippy::used_underscore_binding)]
235240
if let Err(_e) = &result {
236241
opt_error!(error = %_e, "eth_getBlockByHash failed");
237242
}
@@ -255,6 +260,7 @@ impl<N: Network> RobustProvider<N> {
255260
)
256261
.await
257262
.map_err(Error::from);
263+
#[allow(clippy::used_underscore_binding)]
258264
if let Err(_e) = &result {
259265
opt_error!(error = %_e, "eth_getLogs failed");
260266
}
@@ -412,9 +418,12 @@ impl<N: Network> RobustProvider<N> {
412418
self.call_timeout,
413419
(|| operation(provider.clone()))
414420
.retry(retry_strategy)
415-
.notify(|_err: &RpcError<TransportErrorKind>, _dur: Duration| {
416-
opt_info!(error = %_err, "RPC error retrying after {:?}", _dur);
417-
})
421+
.notify(
422+
#[allow(clippy::used_underscore_binding)]
423+
|_err: &RpcError<TransportErrorKind>, _dur: Duration| {
424+
opt_info!(error = %_err, "RPC error retrying after {:?}", _dur);
425+
},
426+
)
418427
.sleep(tokio::time::sleep),
419428
)
420429
.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)