A useful pattern I keep seeing around the internet for unwrapping
RwLock locks is to alias the unwrap for
use LockResult; let num: = new; *num.write.acquire = 20; println!;
LockResult will only ever be an
Err variant when there is a panic while an exclusive lock is in scope (for RwLocks), or when a lock is in scope (for Mutexes), we can unwrap the result so that any panic is propagated.
PoisonError has an
into_inner() function which allows you to recover the guard and have access to the data: