From 657377311d3b041ac7b942e61ddbbe2861c494ec Mon Sep 17 00:00:00 2001 From: Mica White Date: Wed, 25 Dec 2024 11:17:35 -0500 Subject: try_lock returns a Result --- src/rwlock.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/rwlock.rs') 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] -- cgit v1.2.3