Skip to content

Commit 200d0b2

Browse files
committed
refactor: appease clippy lints
For details on lifetime syntax lint, see https://blog.rust-lang.org/2025/08/07/Rust-1.89.0/#mismatched-lifetime-syntaxes-lint.
1 parent 3428679 commit 200d0b2

File tree

11 files changed

+35
-35
lines changed

11 files changed

+35
-35
lines changed

src/cursor.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ impl<'a, Qs> Cursor<'a, Qs> {
6464
/// followed by [`value`](https://developer.mozilla.org/en-US/docs/Web/API/IDBCursorWithValue/value) in JS.
6565
#[errdoc(Cursor(TransactionInactiveError, InvalidStateError))]
6666
#[inline]
67-
pub fn next_record<T>(&mut self) -> CursorNextRequest<T>
67+
pub fn next_record<T>(&mut self) -> CursorNextRequest<'_, T>
6868
where
6969
T: TryFromJs,
7070
{
@@ -73,7 +73,7 @@ impl<'a, Qs> Cursor<'a, Qs> {
7373

7474
/// Mirror of [`Self::next_record`] for `serde`-deserialisable values.
7575
#[cfg(feature = "serde")]
76-
pub fn next_record_ser<T>(&mut self) -> CursorNextRequest<T>
76+
pub fn next_record_ser<T>(&mut self) -> CursorNextRequest<'_, T>
7777
where
7878
T: crate::serde::DeserialiseFromJs,
7979
{
@@ -106,7 +106,7 @@ impl<'a, Qs> Cursor<'a, Qs> {
106106
DataCloneError,
107107
))]
108108
#[inline]
109-
pub fn update<V>(&self, value: V) -> Update<V> {
109+
pub fn update<V>(&self, value: V) -> Update<'_, V> {
110110
Update::new(self, value)
111111
}
112112

src/cursor/key_cursor.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ impl<'a, Qs> KeyCursor<'a, Qs> {
3434
/// followed by [`key`](https://developer.mozilla.org/en-US/docs/Web/API/IDBCursor/key) in JS.
3535
#[inline]
3636
#[errdoc(Cursor(TransactionInactiveError, InvalidStateError))]
37-
pub fn next_key<T>(&mut self) -> CursorNextRequest<T>
37+
pub fn next_key<T>(&mut self) -> CursorNextRequest<'_, T>
3838
where
3939
T: TryFromJs,
4040
{
@@ -44,7 +44,7 @@ impl<'a, Qs> KeyCursor<'a, Qs> {
4444
/// Mirror of [`Self::next_key`] for `serde`-deserialisable keys.
4545
#[inline]
4646
#[cfg(feature = "serde")]
47-
pub fn next_key_ser<T>(&mut self) -> CursorNextRequest<T>
47+
pub fn next_key_ser<T>(&mut self) -> CursorNextRequest<'_, T>
4848
where
4949
T: crate::serde::DeserialiseFromJs,
5050
{

src/cursor/stream.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ impl<'a, Qs, T> Stream<Cursor<'a, Qs>, T> {
9090
DataErrorUpdate,
9191
DataCloneError
9292
))]
93-
pub fn update<V>(&self, value: V) -> super::Update<V> {
93+
pub fn update<V>(&self, value: V) -> super::Update<'_, V> {
9494
self.cursor.update(value)
9595
}
9696

src/database.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ impl Database {
5252
/// Create an object store with the given name.
5353
#[generic_bounds(store_name(N))]
5454
#[inline]
55-
pub fn create_object_store<N>(&self, name: N) -> StoreBuilder<N> {
55+
pub fn create_object_store<N>(&self, name: N) -> StoreBuilder<'_, N> {
5656
StoreBuilder::new(self, name)
5757
}
5858

@@ -99,15 +99,15 @@ impl Database {
9999

100100
/// List the names of the object stores within this database.
101101
#[inline]
102-
pub fn object_store_names(&self) -> DomStringIter {
102+
pub fn object_store_names(&self) -> DomStringIter<'_> {
103103
DomStringIter::new(self.as_sys().object_store_names())
104104
}
105105

106106
/// Start a transaction on the given store name(s). Finish the builder with a call to
107107
/// [`Build::build`](crate::Build::build).
108108
#[errdoc(Database(NotFoundErrorTx, InvalidAccessErrorTx))]
109109
#[inline]
110-
pub fn transaction<S: ObjectStoreName>(&self, store_names: S) -> TransactionBuilder<S> {
110+
pub fn transaction<S: ObjectStoreName>(&self, store_names: S) -> TransactionBuilder<'_, S> {
111111
TransactionBuilder::new(self, store_names)
112112
}
113113

src/future/open_db/listener.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ impl OpenDbListener {
5959
listener: Closure::once(move |evt: web_sys::IdbVersionChangeEvent| {
6060
let res = Database::from_event(&evt).and_then(|db| {
6161
Transaction::from_raw_version_change_event(&db, &evt).and_then(|mut tx| {
62-
callback(VersionChangeEvent::new(evt), &tx).inspect(|_| {
62+
callback(VersionChangeEvent::new(evt), &tx).inspect(|()| {
6363
// If the callback succeeded, we want to ensure that
6464
// the transaction is committed when dropped and not
6565
// aborted.
@@ -181,7 +181,7 @@ const _: () = {
181181
let result = match Transaction::from_raw_version_change_event(&db, &evt) {
182182
Ok(mut transaction) => {
183183
match callback(VersionChangeEvent::new(evt), &transaction).await {
184-
Ok(_) => {
184+
Ok(()) => {
185185
// If the callback succeeded, we want to ensure that
186186
// the transaction is committed when dropped and not
187187
// aborted.

src/index/object_store_ext.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ impl ObjectStore<'_> {
1919
))]
2020
#[generic_bounds(index_name(N), key_path(KP))]
2121
#[inline]
22-
pub fn create_index<N, KP>(&self, name: N, key_path: KeyPath<KP>) -> IndexBuilder<N, KP> {
22+
pub fn create_index<N, KP>(&self, name: N, key_path: KeyPath<KP>) -> IndexBuilder<'_, N, KP> {
2323
IndexBuilder::new(self, name, key_path)
2424
}
2525

@@ -38,15 +38,15 @@ impl ObjectStore<'_> {
3838
/// Open an index with the given name
3939
#[errdoc(Index(InvalidStateErrorIndex, NotFoundError))]
4040
#[allow(clippy::missing_errors_doc)]
41-
pub fn index(&self, name: &str) -> crate::Result<Index> {
41+
pub fn index(&self, name: &str) -> crate::Result<Index<'_>> {
4242
match self.as_sys().index(name) {
4343
Ok(sys) => Ok(Index::new(self, sys)),
4444
Err(e) => Err(e.into()),
4545
}
4646
}
4747

4848
/// Return the names of the indices on this object store.
49-
pub fn index_names(&self) -> DomStringIter {
49+
pub fn index_names(&self) -> DomStringIter<'_> {
5050
DomStringIter::new(self.as_sys().index_names())
5151
}
5252
}

src/key_path.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ pub enum KeyPath<T = String> {
2222

2323
#[generic_bounds(key_path(T))]
2424
impl<T> KeyPath<T> {
25-
/// Convert the key path to a JsValue.
25+
/// Convert the key path to a `JsValue`.
2626
pub fn to_js(&self) -> JsValue {
2727
match self {
2828
Self::One(v) => JsValue::from_str(v.as_ref()),

src/object_store.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ impl<'a> ObjectStore<'a> {
5656
ConstraintError,
5757
))]
5858
#[inline]
59-
pub fn add<V>(&self, value: V) -> Add<V> {
59+
pub fn add<V>(&self, value: V) -> Add<'_, V> {
6060
Add::new(self, value)
6161
}
6262

@@ -80,7 +80,7 @@ impl<'a> ObjectStore<'a> {
8080
ConstraintError,
8181
))]
8282
#[inline]
83-
pub fn put<V>(&self, value: V) -> Put<V> {
83+
pub fn put<V>(&self, value: V) -> Put<'_, V> {
8484
Put::new(self, value)
8585
}
8686

@@ -117,7 +117,7 @@ impl<'a> ObjectStore<'a> {
117117
InvalidStateError,
118118
DataErrorDelete,
119119
))]
120-
pub fn delete<K, I>(&self, key_range: I) -> Delete<K>
120+
pub fn delete<K, I>(&self, key_range: I) -> Delete<'_, K>
121121
where
122122
I: Into<KeyRange<K>>,
123123
{

src/query_source.rs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -30,34 +30,34 @@ mod get_key;
3030
pub trait QuerySource {
3131
/// Count the number of documents in the index/object store.
3232
#[errdoc(QuerySource(InvalidStateError, TransactionInactiveError, DataError))]
33-
fn count(&self) -> Count<Self>
33+
fn count(&self) -> Count<'_, Self>
3434
where
3535
Self: Sized;
3636

3737
/// Get one record from the object store or index. Returns the first match if a non-[only](KeyRange::Only) key is
3838
/// provided and multiple records match.
3939
#[errdoc(QuerySource(InvalidStateError, TransactionInactiveError, DataError))]
40-
fn get<V, K, I>(&self, key: I) -> Get<Self, K, V>
40+
fn get<V, K, I>(&self, key: I) -> Get<'_, Self, K, V>
4141
where
4242
Self: Sized,
4343
I: Into<KeyRange<K>>;
4444

4545
/// Return the first matching key selected by the specified query.
4646
#[errdoc(QuerySource(TransactionInactiveError, InvalidStateError, DataError))]
47-
fn get_key<K, I>(&self, key_range: I) -> GetKey<Self, K>
47+
fn get_key<K, I>(&self, key_range: I) -> GetKey<'_, Self, K>
4848
where
4949
Self: Sized,
5050
I: Into<KeyRange<K>>;
5151

5252
/// Get all records in the object store or index.
5353
#[errdoc(QuerySource(InvalidStateError, TransactionInactiveError, DataError))]
54-
fn get_all<V>(&self) -> GetAllRecords<Self, V>
54+
fn get_all<V>(&self) -> GetAllRecords<'_, Self, V>
5555
where
5656
Self: Sized;
5757

5858
/// Get all keys in the object store or index.
5959
#[errdoc(QuerySource(InvalidStateError, TransactionInactiveError, DataError))]
60-
fn get_all_keys<K>(&self) -> GetAllKeys<Self, K>
60+
fn get_all_keys<K>(&self) -> GetAllKeys<'_, Self, K>
6161
where
6262
Self: Sized;
6363

@@ -77,12 +77,12 @@ pub trait QuerySource {
7777
/// Open a cursor that iterates over the records in the index or object store.
7878
/// Resolves to `None` if the cursor is empty.
7979
#[errdoc(Cursor(TransactionInactiveError, DataErrorOpen, InvalidStateErrorOpen))]
80-
fn open_cursor(&self) -> CursorBuilder<Self> where Self: Sized;
80+
fn open_cursor(&self) -> CursorBuilder<'_, Self> where Self: Sized;
8181

8282
/// Open a cursor that iterates over the keys in the index or object store.
8383
/// Resolves to `None` if the cursor is empty.
8484
#[errdoc(Cursor(TransactionInactiveError, DataErrorOpen, InvalidStateErrorOpen))]
85-
fn open_key_cursor(&self) -> KeyCursorBuilder<Self> where Self: Sized;
85+
fn open_key_cursor(&self) -> KeyCursorBuilder<'_, Self> where Self: Sized;
8686
}
8787
}
8888

@@ -99,7 +99,7 @@ impl<T: SystemRepr<Repr = R>, R: QuerySourceInternal> QuerySource for T {
9999
}
100100

101101
#[inline]
102-
fn count(&self) -> Count<Self> {
102+
fn count(&self) -> Count<'_, Self> {
103103
Count::new(self)
104104
}
105105

@@ -110,39 +110,39 @@ impl<T: SystemRepr<Repr = R>, R: QuerySourceInternal> QuerySource for T {
110110
}
111111
}
112112

113-
fn get<V, K, I>(&self, key: I) -> Get<Self, K, V>
113+
fn get<V, K, I>(&self, key: I) -> Get<'_, Self, K, V>
114114
where
115115
I: Into<KeyRange<K>>,
116116
{
117117
Get::new(self, key.into())
118118
}
119119

120-
fn get_key<K, I>(&self, key_range: I) -> GetKey<Self, K>
120+
fn get_key<K, I>(&self, key_range: I) -> GetKey<'_, Self, K>
121121
where
122122
I: Into<KeyRange<K>>,
123123
{
124124
GetKey::new(self, key_range.into())
125125
}
126126

127127
#[inline]
128-
fn get_all<V>(&self) -> GetAllRecords<Self, V> {
128+
fn get_all<V>(&self) -> GetAllRecords<'_, Self, V> {
129129
GetAllRecords::new(self)
130130
}
131131

132132
#[inline]
133-
fn get_all_keys<K>(&self) -> GetAllKeys<Self, K> {
133+
fn get_all_keys<K>(&self) -> GetAllKeys<'_, Self, K> {
134134
GetAllKeys::new(self)
135135
}
136136

137137
iffeat! {
138138
#[cfg(feature = "cursors")]
139139
#[inline]
140-
fn open_cursor(&self) -> CursorBuilder<Self> {
140+
fn open_cursor(&self) -> CursorBuilder<'_, Self> {
141141
CursorBuilder::new(self)
142142
}
143143

144144
#[inline]
145-
fn open_key_cursor(&self) -> KeyCursorBuilder<Self> {
145+
fn open_key_cursor(&self) -> KeyCursorBuilder<'_, Self> {
146146
KeyCursorBuilder::new(self)
147147
}
148148
}

src/transaction/base.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ impl<'a> TransactionRef<'a> {
3232
/// Get an object store that's part of the transaction.
3333
#[errdoc(Transaction(NotFoundError, InvalidStateError))]
3434
#[allow(clippy::missing_errors_doc)]
35-
pub fn object_store(&self, name: &str) -> crate::Result<ObjectStore> {
35+
pub fn object_store(&self, name: &str) -> crate::Result<ObjectStore<'_>> {
3636
match self.as_sys().object_store(name) {
3737
Ok(store) => Ok(ObjectStore::new(store, self)),
3838
Err(e) => Err(e.into()),
@@ -41,7 +41,7 @@ impl<'a> TransactionRef<'a> {
4141

4242
/// Get an iterator of the names of [`IdbObjectStore`](ObjectStore) objects
4343
/// associated with the transaction.
44-
pub fn object_store_names(&self) -> DomStringIter {
44+
pub fn object_store_names(&self) -> DomStringIter<'_> {
4545
DomStringIter::new(self.as_sys().object_store_names())
4646
}
4747

0 commit comments

Comments
 (0)