diff options
| author | Mica White <botahamec@outlook.com> | 2024-03-10 11:08:50 -0400 |
|---|---|---|
| committer | Mica White <botahamec@outlook.com> | 2024-03-10 11:08:50 -0400 |
| commit | 61d709c211132adcc5158ded77c17d690ad5f8da (patch) | |
| tree | 181195bc8c659721dc48df83a14798f6944623ec /examples/list.rs | |
| parent | ff8c634a303d4a4133accf5fbff375046f022c7f (diff) | |
OwnedLockable
Diffstat (limited to 'examples/list.rs')
| -rw-r--r-- | examples/list.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/list.rs b/examples/list.rs index 368a633..14117ee 100644 --- a/examples/list.rs +++ b/examples/list.rs @@ -37,7 +37,7 @@ fn main() { data.push(&DATA[rand % 6]); } - let Some(lock) = LockCollection::new(data) else { + let Some(lock) = LockCollection::try_new(data) else { continue; }; let mut guard = lock.lock(&mut key); @@ -56,7 +56,7 @@ fn main() { } let key = ThreadKey::lock().unwrap(); - let data = LockCollection::new(&DATA).unwrap(); + let data = LockCollection::new_ref(&DATA); let data = data.lock(key); for val in &*data { println!("{}", **val); |
