summaryrefslogtreecommitdiff
path: root/src/rwlock.rs
diff options
context:
space:
mode:
authorMica White <botahamec@gmail.com>2024-12-25 11:17:35 -0500
committerMica White <botahamec@gmail.com>2024-12-25 11:17:35 -0500
commit657377311d3b041ac7b942e61ddbbe2861c494ec (patch)
tree5e041812c67e7ef0451b35d0b33ee90be28fbeaf /src/rwlock.rs
parent7e2a3aa417beb33c76fe98fbe49515c524cb0183 (diff)
try_lock returns a Result
Diffstat (limited to 'src/rwlock.rs')
-rw-r--r--src/rwlock.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/rwlock.rs b/src/rwlock.rs
index 9b65a0b..64dc82b 100644
--- a/src/rwlock.rs
+++ b/src/rwlock.rs
@@ -126,7 +126,7 @@ mod tests {
let lock: crate::RwLock<_> = RwLock::new("Hello, world!");
assert!(!lock.is_locked());
- assert!(lock.try_write(key).is_some());
+ assert!(lock.try_write(key).is_ok());
}
#[test]
@@ -135,7 +135,7 @@ mod tests {
let lock: crate::RwLock<_> = RwLock::new("Hello, world!");
let reader = ReadLock::new(&lock);
- assert!(reader.try_lock(key).is_some());
+ assert!(reader.try_lock(key).is_ok());
}
#[test]
@@ -144,7 +144,7 @@ mod tests {
let lock: crate::RwLock<_> = RwLock::new("Hello, world!");
let writer = WriteLock::new(&lock);
- assert!(writer.try_lock(key).is_some());
+ assert!(writer.try_lock(key).is_ok());
}
#[test]