summaryrefslogtreecommitdiff
path: root/src/collection/ref.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/collection/ref.rs')
-rwxr-xr-x[-rw-r--r--]src/collection/ref.rs16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/collection/ref.rs b/src/collection/ref.rs
index e71624d..d180ab0 100644..100755
--- a/src/collection/ref.rs
+++ b/src/collection/ref.rs
@@ -240,14 +240,18 @@ impl<'a, L: Lockable> RefLockCollection<'a, L> {
Some(Self { data, locks })
}
- pub fn scoped_lock<'s, R>(&'s self, key: impl Keyable, f: impl Fn(L::DataMut<'s>) -> R) -> R {
+ pub fn scoped_lock<'s, R>(
+ &'s self,
+ key: impl Keyable,
+ f: impl FnOnce(L::DataMut<'s>) -> R,
+ ) -> R {
scoped_write(self, key, f)
}
pub fn scoped_try_lock<'s, Key: Keyable, R>(
&'s self,
key: Key,
- f: impl Fn(L::DataMut<'s>) -> R,
+ f: impl FnOnce(L::DataMut<'s>) -> R,
) -> Result<R, Key> {
scoped_try_write(self, key, f)
}
@@ -355,14 +359,18 @@ impl<'a, L: Lockable> RefLockCollection<'a, L> {
}
impl<L: Sharable> RefLockCollection<'_, 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)
}