Skip to content

Commit a84f892

Browse files
committed
Fix clippy lints
1 parent 36ca56d commit a84f892

File tree

13 files changed

+23
-23
lines changed

13 files changed

+23
-23
lines changed

crates/commitlog/src/index/indexfile.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ impl<Key: Into<u64> + From<u64>> IndexFileMut<Key> {
227227
}
228228

229229
/// Obtain an iterator over the entries of the index.
230-
pub fn entries(&self) -> Entries<Key> {
230+
pub fn entries(&self) -> Entries<'_, Key> {
231231
Entries {
232232
mmap: &self.inner,
233233
pos: 0,
@@ -277,7 +277,7 @@ impl<Key: Into<u64> + From<u64>> IndexFile<Key> {
277277
}
278278

279279
/// Obtain an iterator over the entries of the index.
280-
pub fn entries(&self) -> Entries<Key> {
280+
pub fn entries(&self) -> Entries<'_, Key> {
281281
self.inner.entries()
282282
}
283283
}

crates/core/src/database_logger.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ impl SystemLogger {
316316
self.inner.write(LogLevel::Error, &Self::record(msg), &())
317317
}
318318

319-
fn record(message: &str) -> Record {
319+
fn record(message: &str) -> Record<'_> {
320320
Record::injected(message)
321321
}
322322
}

crates/core/src/db/relational_db.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1524,7 +1524,7 @@ where
15241524
last_logged_percentage = percentage;
15251525
}
15261526
// Print _something_ even if we don't know what's still ahead.
1527-
} else if tx_offset % 10_000 == 0 {
1527+
} else if tx_offset.is_multiple_of(10_000) {
15281528
log::info!("[{database_identity}] Loading transaction {tx_offset}");
15291529
}
15301530
};

crates/core/src/host/wasmtime/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ impl MemView {
269269

270270
/// Lossily get a utf8 slice of wasm memory given a pointer and a length, converting any
271271
/// non-utf8 bytes to `U+FFFD REPLACEMENT CHARACTER`.
272-
fn deref_str_lossy(&self, offset: WasmPtr<u8>, len: u32) -> Result<Cow<str>, MemError> {
272+
fn deref_str_lossy(&self, offset: WasmPtr<u8>, len: u32) -> Result<Cow<'_, str>, MemError> {
273273
self.deref_slice(offset, len).map(String::from_utf8_lossy)
274274
}
275275

crates/core/src/subscription/tx.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ impl DeltaStore for DeltaTx<'_> {
171171
index_id: IndexId,
172172
delta: Delta,
173173
range: impl RangeBounds<AlgebraicValue>,
174-
) -> impl Iterator<Item = Row> {
174+
) -> impl Iterator<Item = Row<'_>> {
175175
fn scan_index<'a>(
176176
data: Option<&'a TxData>,
177177
indexes: &'a DeltaTableIndexes,
@@ -221,7 +221,7 @@ impl DeltaStore for DeltaTx<'_> {
221221
index_id: IndexId,
222222
delta: Delta,
223223
point: &AlgebraicValue,
224-
) -> impl Iterator<Item = Row> {
224+
) -> impl Iterator<Item = Row<'_>> {
225225
self.index_scan_range_for_delta(table_id, index_id, delta, point)
226226
}
227227
}

crates/datastore/src/locking_tx_datastore/mut_tx.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ impl DeltaStore for MutTxId {
122122
_: IndexId,
123123
_: spacetimedb_lib::query::Delta,
124124
_: impl RangeBounds<AlgebraicValue>,
125-
) -> impl Iterator<Item = Row> {
125+
) -> impl Iterator<Item = Row<'_>> {
126126
std::iter::empty()
127127
}
128128

@@ -134,7 +134,7 @@ impl DeltaStore for MutTxId {
134134
_: IndexId,
135135
_: spacetimedb_lib::query::Delta,
136136
_: &AlgebraicValue,
137-
) -> impl Iterator<Item = Row> {
137+
) -> impl Iterator<Item = Row<'_>> {
138138
std::iter::empty()
139139
}
140140
}

crates/execution/src/lib.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ pub trait Datastore {
3333
.ok_or_else(|| anyhow!("TableId `{table_id}` does not exist"))
3434
}
3535

36-
fn table_scan(&self, table_id: TableId) -> Result<TableScanIter> {
36+
fn table_scan(&self, table_id: TableId) -> Result<TableScanIter<'_>> {
3737
self.table(table_id)
3838
.map(|table| table.scan_rows(self.blob_store()))
3939
.ok_or_else(|| anyhow!("TableId `{table_id}` does not exist"))
@@ -44,7 +44,7 @@ pub trait Datastore {
4444
table_id: TableId,
4545
index_id: IndexId,
4646
key: &AlgebraicValue,
47-
) -> Result<IndexScanPointIter> {
47+
) -> Result<IndexScanPointIter<'_>> {
4848
self.table(table_id)
4949
.ok_or_else(|| anyhow!("TableId `{table_id}` does not exist"))
5050
.and_then(|table| {
@@ -60,7 +60,7 @@ pub trait Datastore {
6060
table_id: TableId,
6161
index_id: IndexId,
6262
range: &impl RangeBounds<AlgebraicValue>,
63-
) -> Result<IndexScanRangeIter> {
63+
) -> Result<IndexScanRangeIter<'_>> {
6464
self.table(table_id)
6565
.ok_or_else(|| anyhow!("TableId `{table_id}` does not exist"))
6666
.and_then(|table| {
@@ -93,17 +93,17 @@ pub trait DeltaStore {
9393
index_id: IndexId,
9494
delta: Delta,
9595
range: impl RangeBounds<AlgebraicValue>,
96-
) -> impl Iterator<Item = Row>;
96+
) -> impl Iterator<Item = Row<'_>>;
9797

9898
fn index_scan_point_for_delta(
9999
&self,
100100
table_id: TableId,
101101
index_id: IndexId,
102102
delta: Delta,
103103
point: &AlgebraicValue,
104-
) -> impl Iterator<Item = Row>;
104+
) -> impl Iterator<Item = Row<'_>>;
105105

106-
fn delta_scan(&self, table_id: TableId, inserts: bool) -> DeltaScanIter {
106+
fn delta_scan(&self, table_id: TableId, inserts: bool) -> DeltaScanIter<'_> {
107107
match inserts {
108108
true => DeltaScanIter {
109109
iter: self.inserts_for_table(table_id),

crates/lib/src/db/raw_def/v9.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,7 @@ impl RawModuleDefV9Builder {
488488
&mut self,
489489
name: impl Into<RawIdentifier>,
490490
product_type_ref: AlgebraicTypeRef,
491-
) -> RawTableDefBuilder {
491+
) -> RawTableDefBuilder<'_> {
492492
let name = name.into();
493493
RawTableDefBuilder {
494494
module_def: &mut self.module,
@@ -513,7 +513,7 @@ impl RawModuleDefV9Builder {
513513
table_name: impl Into<RawIdentifier>,
514514
product_type: impl Into<spacetimedb_sats::ProductType>,
515515
custom_ordering: bool,
516-
) -> RawTableDefBuilder {
516+
) -> RawTableDefBuilder<'_> {
517517
let table_name = table_name.into();
518518

519519
let product_type_ref = self.add_algebraic_type(
@@ -533,7 +533,7 @@ impl RawModuleDefV9Builder {
533533
table_name: impl Into<RawIdentifier>,
534534
mut product_type: spacetimedb_sats::ProductType,
535535
custom_ordering: bool,
536-
) -> RawTableDefBuilder {
536+
) -> RawTableDefBuilder<'_> {
537537
self.add_expand_product_type_for_tests(&mut 0, &mut product_type);
538538

539539
self.build_table_with_new_type(table_name, product_type, custom_ordering)

crates/sats/src/array_value.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ impl ArrayValue {
113113
}
114114

115115
/// Returns a cloning iterator on the elements of `self` as `AlgebraicValue`s.
116-
pub fn iter_cloned(&self) -> ArrayValueIterCloned {
116+
pub fn iter_cloned(&self) -> ArrayValueIterCloned<'_> {
117117
match self {
118118
ArrayValue::Sum(v) => ArrayValueIterCloned::Sum(v.iter()),
119119
ArrayValue::Product(v) => ArrayValueIterCloned::Product(v.iter()),

crates/schema/src/def.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ impl ModuleDef {
253253
pub fn reducer_arg_deserialize_seed<K: ?Sized + Hash + Equivalent<Identifier>>(
254254
&self,
255255
name: &K,
256-
) -> Option<(ReducerId, ReducerArgsDeserializeSeed)> {
256+
) -> Option<(ReducerId, ReducerArgsDeserializeSeed<'_>)> {
257257
let (id, reducer) = self.reducer_full(name)?;
258258
Some((id, ReducerArgsDeserializeSeed(self.typespace.with_type(reducer))))
259259
}

0 commit comments

Comments
 (0)