diff options
Diffstat (limited to 'src/collection/retry.rs')
| -rwxr-xr-x[-rw-r--r--] | src/collection/retry.rs | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/collection/retry.rs b/src/collection/retry.rs index 15f626d..e127c20 100644..100755 --- a/src/collection/retry.rs +++ b/src/collection/retry.rs @@ -534,14 +534,18 @@ impl<L: Lockable> RetryingLockCollection<L> { (!contains_duplicates(&data)).then_some(unsafe { Self::new_unchecked(data) }) } - pub fn scoped_lock<'a, R>(&'a self, key: impl Keyable, f: impl Fn(L::DataMut<'a>) -> R) -> R { + pub fn scoped_lock<'a, R>( + &'a self, + key: impl Keyable, + f: impl FnOnce(L::DataMut<'a>) -> R, + ) -> R { scoped_write(self, key, f) } pub fn scoped_try_lock<'a, Key: Keyable, R>( &'a self, key: Key, - f: impl Fn(L::DataMut<'a>) -> R, + f: impl FnOnce(L::DataMut<'a>) -> R, ) -> Result<R, Key> { scoped_try_write(self, key, f) } @@ -649,14 +653,18 @@ impl<L: Lockable> RetryingLockCollection<L> { } impl<L: Sharable> RetryingLockCollection<L> { - pub fn scoped_read<'a, R>(&'a self, key: impl Keyable, f: impl Fn(L::DataRef<'a>) -> R) -> R { + pub fn scoped_read<'a, R>( + &'a self, + key: impl Keyable, + f: impl FnOnce(L::DataRef<'a>) -> R, + ) -> R { scoped_read(self, key, f) } pub fn scoped_try_read<'a, Key: Keyable, R>( &'a self, key: Key, - f: impl Fn(L::DataRef<'a>) -> R, + f: impl FnOnce(L::DataRef<'a>) -> R, ) -> Result<R, Key> { scoped_try_read(self, key, f) } |
