Skip to content

Commit d548e1a

Browse files
committed
Lifetime
1 parent f673014 commit d548e1a

1 file changed

Lines changed: 17 additions & 17 deletions

File tree

keyhive_wasm/src/js/secret_key_store.rs

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -124,17 +124,17 @@ impl SecretKeyStore<Local> for JsSecretKeyStore {
124124
type ImportError = JsSecretKeyStoreError;
125125
type GenerateError = JsSecretKeyStoreError;
126126

127-
fn get_secret_key(
128-
&self,
129-
public_key: &ShareKey,
130-
) -> <Local as FutureForm>::Future<'_, Result<Option<ShareSecretKey>, Self::GetError>> {
127+
fn get_secret_key<'a>(
128+
&'a self,
129+
public_key: &'a ShareKey,
130+
) -> <Local as FutureForm>::Future<'a, Result<Option<ShareSecretKey>, Self::GetError>> {
131131
Local::from_future(async move { Ok(self.cache.lock().await.get(public_key).copied()) })
132132
}
133133

134-
fn import_secret_key(
135-
&self,
134+
fn import_secret_key<'a>(
135+
&'a self,
136136
secret_key: ShareSecretKey,
137-
) -> <Local as FutureForm>::Future<'_, Result<ShareKey, Self::ImportError>> {
137+
) -> <Local as FutureForm>::Future<'a, Result<ShareKey, Self::ImportError>> {
138138
Local::from_future(async move {
139139
let pk = secret_key.share_key();
140140
self.cache.lock().await.insert(pk, secret_key);
@@ -143,10 +143,10 @@ impl SecretKeyStore<Local> for JsSecretKeyStore {
143143
})
144144
}
145145

146-
fn import_raw_secret_key(
147-
&self,
146+
fn import_raw_secret_key<'a>(
147+
&'a self,
148148
raw: ShareSecretKey,
149-
) -> <Local as FutureForm>::Future<'_, Result<ShareSecretKey, Self::ImportError>> {
149+
) -> <Local as FutureForm>::Future<'a, Result<ShareSecretKey, Self::ImportError>> {
150150
Local::from_future(async move {
151151
let pk = raw.share_key();
152152
self.cache.lock().await.insert(pk, raw);
@@ -155,9 +155,9 @@ impl SecretKeyStore<Local> for JsSecretKeyStore {
155155
})
156156
}
157157

158-
fn generate_secret_key(
159-
&self,
160-
) -> <Local as FutureForm>::Future<'_, Result<ShareSecretKey, Self::GenerateError>> {
158+
fn generate_secret_key<'a>(
159+
&'a self,
160+
) -> <Local as FutureForm>::Future<'a, Result<ShareSecretKey, Self::GenerateError>> {
161161
Local::from_future(async move {
162162
let sk = ShareSecretKey::generate(&mut rand::thread_rng());
163163
let pk = sk.share_key();
@@ -167,10 +167,10 @@ impl SecretKeyStore<Local> for JsSecretKeyStore {
167167
})
168168
}
169169

170-
fn contains_secret_key(
171-
&self,
172-
public_key: &ShareKey,
173-
) -> <Local as FutureForm>::Future<'_, Result<bool, Self::GetError>> {
170+
fn contains_secret_key<'a>(
171+
&'a self,
172+
public_key: &'a ShareKey,
173+
) -> <Local as FutureForm>::Future<'a, Result<bool, Self::GetError>> {
174174
Local::from_future(async move { Ok(self.cache.lock().await.contains_key(public_key)) })
175175
}
176176
}

0 commit comments

Comments
 (0)