summaryrefslogtreecommitdiff
path: root/src/rwlock/read_guard.rs
diff options
context:
space:
mode:
authorMica White <botahamec@outlook.com>2025-03-09 20:49:56 -0400
committerMica White <botahamec@outlook.com>2025-03-09 20:49:56 -0400
commit58abf5872023aca7ee6459fa3b2e067d57923ba5 (patch)
tree196cadda0dd4386668477ef286f9c9b09480e713 /src/rwlock/read_guard.rs
parent4ba03be97e6cc7e790bbc9bfc18caaa228c8a262 (diff)
Finish testing and fixing
Diffstat (limited to 'src/rwlock/read_guard.rs')
-rw-r--r--src/rwlock/read_guard.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/rwlock/read_guard.rs b/src/rwlock/read_guard.rs
index 0d68c75..5b26c06 100644
--- a/src/rwlock/read_guard.rs
+++ b/src/rwlock/read_guard.rs
@@ -64,7 +64,7 @@ impl<'a, T: ?Sized, R: RawRwLock> RwLockReadRef<'a, T, R> {
/// Creates an immutable reference for the underlying data of an [`RwLock`]
/// without locking it or taking ownership of the key.
#[must_use]
- pub(crate) unsafe fn new(mutex: &'a RwLock<T, R>) -> Self {
+ pub(crate) const unsafe fn new(mutex: &'a RwLock<T, R>) -> Self {
Self(mutex, PhantomData)
}
}
@@ -109,7 +109,7 @@ impl<'a, T: ?Sized, R: RawRwLock> RwLockReadGuard<'a, T, R> {
/// Create a guard to the given mutex. Undefined if multiple guards to the
/// same mutex exist at once.
#[must_use]
- pub(super) unsafe fn new(rwlock: &'a RwLock<T, R>, thread_key: ThreadKey) -> Self {
+ pub(super) const unsafe fn new(rwlock: &'a RwLock<T, R>, thread_key: ThreadKey) -> Self {
Self {
rwlock: RwLockReadRef(rwlock, PhantomData),
thread_key,