Skip to content

Commit e24c608

Browse files
committed
Fix mismatched_lifetime_syntaxes warnings
This became a warning since Rust v1.89.0: https://blog.rust-lang.org/2025/08/07/Rust-1.89.0/#mismatched-lifetime-syntaxes-lint
1 parent 1f46304 commit e24c608

6 files changed

Lines changed: 17 additions & 12 deletions

File tree

src/elements/peg.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use elements::{confidential::Asset, PeginData, PegoutData, TxIn, TxOut};
33
use crate::chain::{bitcoin_genesis_hash, BNetwork, Network};
44
use crate::util::{FullHash, ScriptToAsm};
55

6-
pub fn get_pegin_data(txout: &TxIn, network: Network) -> Option<PeginData> {
6+
pub fn get_pegin_data(txout: &TxIn, network: Network) -> Option<PeginData<'_>> {
77
let pegged_asset_id = network.pegged_asset()?;
88
txout
99
.pegin_data()
@@ -14,7 +14,7 @@ pub fn get_pegout_data(
1414
txout: &TxOut,
1515
network: Network,
1616
parent_network: BNetwork,
17-
) -> Option<PegoutData> {
17+
) -> Option<PegoutData<'_>> {
1818
let pegged_asset_id = network.pegged_asset()?;
1919
txout.pegout_data().filter(|pegout| {
2020
pegout.asset == Asset::Explicit(*pegged_asset_id)

src/elements/registry.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ impl AssetRegistry {
4040
start_index: usize,
4141
limit: usize,
4242
sorting: AssetSorting,
43-
) -> (usize, Vec<AssetEntry>) {
43+
) -> (usize, Vec<AssetEntry<'_>>) {
4444
let mut assets: Vec<AssetEntry> = self
4545
.assets_cache
4646
.iter()

src/new_index/db.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -137,19 +137,19 @@ impl DB {
137137
self.db.set_options(&opts).unwrap();
138138
}
139139

140-
pub fn raw_iterator(&self) -> rocksdb::DBRawIterator {
140+
pub fn raw_iterator(&self) -> rocksdb::DBRawIterator<'_> {
141141
self.db.raw_iterator()
142142
}
143143

144-
pub fn iter_scan(&self, prefix: &[u8]) -> ScanIterator {
144+
pub fn iter_scan(&self, prefix: &[u8]) -> ScanIterator<'_> {
145145
ScanIterator {
146146
prefix: prefix.to_vec(),
147147
iter: self.db.prefix_iterator(prefix),
148148
done: false,
149149
}
150150
}
151151

152-
pub fn iter_scan_from(&self, prefix: &[u8], start_at: &[u8]) -> ScanIterator {
152+
pub fn iter_scan_from(&self, prefix: &[u8], start_at: &[u8]) -> ScanIterator<'_> {
153153
let iter = self.db.iterator(rocksdb::IteratorMode::From(
154154
start_at,
155155
rocksdb::Direction::Forward,
@@ -161,7 +161,7 @@ impl DB {
161161
}
162162
}
163163

164-
pub fn iter_scan_reverse(&self, prefix: &[u8], prefix_max: &[u8]) -> ReverseScanIterator {
164+
pub fn iter_scan_reverse(&self, prefix: &[u8], prefix_max: &[u8]) -> ReverseScanIterator<'_> {
165165
let mut iter = self.db.raw_iterator();
166166
iter.seek_for_prev(prefix_max);
167167

src/new_index/query.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ impl Query {
6565
self.config.network_type
6666
}
6767

68-
pub fn mempool(&self) -> RwLockReadGuard<Mempool> {
68+
pub fn mempool(&self) -> RwLockReadGuard<'_, Mempool> {
6969
self.mempool.read().unwrap()
7070
}
7171

src/new_index/schema.rs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ impl Store {
124124
&self.cache_db
125125
}
126126

127-
pub fn headers(&self) -> RwLockReadGuard<HeaderList> {
127+
pub fn headers(&self) -> RwLockReadGuard<'_, HeaderList> {
128128
self.indexed_headers.read().unwrap()
129129
}
130130

@@ -599,14 +599,19 @@ impl ChainQuery {
599599
})
600600
}
601601

602-
pub fn history_iter_scan(&self, code: u8, hash: &[u8], start_height: usize) -> ScanIterator {
602+
pub fn history_iter_scan(
603+
&self,
604+
code: u8,
605+
hash: &[u8],
606+
start_height: usize,
607+
) -> ScanIterator<'_> {
603608
self.store.history_db.iter_scan_from(
604609
&TxHistoryRow::filter(code, &hash[..]),
605610
&TxHistoryRow::prefix_height(code, &hash[..], start_height as u32),
606611
)
607612
}
608613

609-
fn history_iter_scan_reverse(&self, code: u8, hash: &[u8]) -> ReverseScanIterator {
614+
fn history_iter_scan_reverse(&self, code: u8, hash: &[u8]) -> ReverseScanIterator<'_> {
610615
self.store.history_db.iter_scan_reverse(
611616
&TxHistoryRow::filter(code, &hash[..]),
612617
&TxHistoryRow::prefix_end(code, &hash[..]),

src/util/block.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ impl HeaderList {
285285
self.headers.is_empty()
286286
}
287287

288-
pub fn iter(&self) -> slice::Iter<HeaderEntry> {
288+
pub fn iter(&self) -> slice::Iter<'_, HeaderEntry> {
289289
self.headers.iter()
290290
}
291291

0 commit comments

Comments
 (0)