Skip to content

Commit 8164df4

Browse files
committed
ref: clippy
1 parent 0b32021 commit 8164df4

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

src/event_scanner/scanner.rs

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ impl EventScannerBuilder<Unspecified> {
136136
/// - **Completion**: The scanner completes when the entire range has been processed
137137
#[must_use]
138138
pub fn historic() -> EventScannerBuilder<Historic> {
139-
Default::default()
139+
EventScannerBuilder::default()
140140
}
141141

142142
/// Streams new events as blocks are produced on-chain.
@@ -204,7 +204,7 @@ impl EventScannerBuilder<Unspecified> {
204204
/// [reorg]: crate::types::ScannerStatus::ReorgDetected
205205
#[must_use]
206206
pub fn live() -> EventScannerBuilder<Live> {
207-
Default::default()
207+
EventScannerBuilder::default()
208208
}
209209

210210
/// Creates a builder for sync mode scanners that combine historical catch-up with live
@@ -222,7 +222,7 @@ impl EventScannerBuilder<Unspecified> {
222222
/// See the [sync module documentation](sync) for details on each mode.
223223
#[must_use]
224224
pub fn sync() -> EventScannerBuilder<Synchronize> {
225-
Default::default()
225+
EventScannerBuilder::default()
226226
}
227227

228228
/// Streams the latest `count` matching events per registered listener.
@@ -326,25 +326,27 @@ impl EventScannerBuilder<Unspecified> {
326326
}
327327
}
328328

329-
impl EventScannerBuilder<SyncFromLatestEvents> {
329+
impl EventScannerBuilder<LatestEvents> {
330+
#[must_use]
330331
pub fn new(count: usize) -> Self {
331332
Self {
332-
config: SyncFromLatestEvents {
333+
config: LatestEvents {
333334
count,
335+
from_block: BlockNumberOrTag::Latest,
336+
to_block: BlockNumberOrTag::Earliest,
334337
block_confirmations: DEFAULT_BLOCK_CONFIRMATIONS,
335338
},
336339
block_range_scanner: BlockRangeScanner::default(),
337340
}
338341
}
339342
}
340343

341-
impl EventScannerBuilder<LatestEvents> {
344+
impl EventScannerBuilder<SyncFromLatestEvents> {
345+
#[must_use]
342346
pub fn new(count: usize) -> Self {
343347
Self {
344-
config: LatestEvents {
348+
config: SyncFromLatestEvents {
345349
count,
346-
from_block: BlockNumberOrTag::Latest,
347-
to_block: BlockNumberOrTag::Earliest,
348350
block_confirmations: DEFAULT_BLOCK_CONFIRMATIONS,
349351
},
350352
block_range_scanner: BlockRangeScanner::default(),
@@ -353,6 +355,7 @@ impl EventScannerBuilder<LatestEvents> {
353355
}
354356

355357
impl EventScannerBuilder<SyncFromBlock> {
358+
#[must_use]
356359
pub fn new(from_block: BlockNumberOrTag) -> Self {
357360
Self {
358361
config: SyncFromBlock { from_block, block_confirmations: DEFAULT_BLOCK_CONFIRMATIONS },

0 commit comments

Comments
 (0)