summaryrefslogtreecommitdiff
path: root/src/collection/boxed.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/collection/boxed.rs')
-rwxr-xr-xsrc/collection/boxed.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/collection/boxed.rs b/src/collection/boxed.rs
index 234fa07..83675b5 100755
--- a/src/collection/boxed.rs
+++ b/src/collection/boxed.rs
@@ -560,10 +560,10 @@ impl<L: Sharable> BoxedLockCollection<L> {
/// # Example
///
/// ```
- /// use happylock::{LockCollection, ThreadKey, Mutex};
+ /// use happylock::{LockCollection, ThreadKey, RwLock};
///
/// let mut key = ThreadKey::get().unwrap();
- /// let data = (Mutex::new(0), Mutex::new(""));
+ /// let data = (RwLock::new(0), RwLock::new(""));
/// let lock = LockCollection::new(data);
///
/// lock.scoped_read(&mut key, |(number, string)| {
@@ -602,15 +602,15 @@ impl<L: Sharable> BoxedLockCollection<L> {
/// # Example
///
/// ```
- /// use happylock::{LockCollection, ThreadKey, Mutex};
+ /// use happylock::{LockCollection, ThreadKey, RwLock};
///
/// let mut key = ThreadKey::get().unwrap();
- /// let data = (Mutex::new(0), Mutex::new(""));
+ /// let data = (RwLock::new(0), RwLock::new(""));
/// let lock = LockCollection::new(data);
///
/// lock.scoped_try_read(&mut key, |(number, string)| {
- /// *number += 1;
- /// *string = "1";
+ /// assert_eq!(*number, 0);
+ /// assert_eq!(*string, "");
/// }).expect("This lock has not yet been locked");
/// ```
///