Skip to content

Commit 83a37a3

Browse files
committed
ref: make all start fns accept immutable self
1 parent 7349982 commit 83a37a3

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/block_range_scanner/scanner.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ impl<N: Network> BlockRangeScanner<N> {
132132
/// * [`ScannerError::Timeout`] - if an RPC call required for startup times out.
133133
/// * [`ScannerError::RpcError`] - if an RPC call required for startup fails.
134134
pub async fn stream_live(
135-
&mut self,
135+
&self,
136136
block_confirmations: u64,
137137
) -> Result<ReceiverStream<BlockScannerResult>, ScannerError> {
138138
info!("Starting live stream");
@@ -185,7 +185,7 @@ impl<N: Network> BlockRangeScanner<N> {
185185
/// * [`ScannerError::RpcError`] - if an RPC call required for startup fails.
186186
/// * [`ScannerError::BlockNotFound`] - if `start_id` or `end_id` cannot be resolved.
187187
pub async fn stream_historical(
188-
&mut self,
188+
&self,
189189
start_id: impl Into<BlockId>,
190190
end_id: impl Into<BlockId>,
191191
) -> Result<ReceiverStream<BlockScannerResult>, ScannerError> {

src/event_scanner/scanner/historic.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ impl<N: Network> EventScanner<Historic, N> {
133133
/// * [`ScannerError::Timeout`] - if an RPC call required for startup times out.
134134
/// * [`ScannerError::RpcError`] - if an RPC call required for startup fails.
135135
/// * [`ScannerError::BlockNotFound`] - if `from_block` or `to_block` cannot be resolved.
136-
pub async fn start(mut self) -> Result<(), ScannerError> {
136+
pub async fn start(self) -> Result<(), ScannerError> {
137137
let stream = self
138138
.block_range_scanner
139139
.stream_historical(self.config.from_block, self.config.to_block)

src/event_scanner/scanner/live.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ impl<N: Network> EventScanner<Live, N> {
6767
///
6868
/// * [`ScannerError::Timeout`] - if an RPC call required for startup times out.
6969
/// * [`ScannerError::RpcError`] - if an RPC call required for startup fails.
70-
pub async fn start(mut self) -> Result<(), ScannerError> {
70+
pub async fn start(self) -> Result<(), ScannerError> {
7171
let stream = self.block_range_scanner.stream_live(self.config.block_confirmations).await?;
7272
let max_concurrent_fetches = self.config.max_concurrent_fetches;
7373
let provider = self.block_range_scanner.provider().clone();

0 commit comments

Comments
 (0)