Skip to content

Commit 18119af

Browse files
committed
Move Rc tests away from Cell
1 parent 7c9daa8 commit 18119af

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/libstd/rc.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -105,26 +105,26 @@ impl<T> Drop for Rc<T> {
105105
#[cfg(test)]
106106
mod test_rc {
107107
use super::*;
108-
use cell::Cell;
108+
use mutable::Mut;
109109

110110
#[test]
111111
fn test_clone() {
112-
let x = Rc::from_send(Cell::new(5));
112+
let x = Rc::from_send(Mut::new(5));
113113
let y = x.clone();
114-
do x.borrow().with_mut_ref |inner| {
114+
do x.borrow().map_mut |inner| {
115115
*inner = 20;
116116
}
117-
assert_eq!(y.borrow().take(), 20);
117+
assert_eq!(y.borrow().map(|v| *v), 20);
118118
}
119119

120120
#[test]
121121
fn test_deep_clone() {
122-
let x = Rc::from_send(Cell::new(5));
122+
let x = Rc::from_send(Mut::new(5));
123123
let y = x.deep_clone();
124-
do x.borrow().with_mut_ref |inner| {
124+
do x.borrow().map_mut |inner| {
125125
*inner = 20;
126126
}
127-
assert_eq!(y.borrow().take(), 5);
127+
assert_eq!(y.borrow().map(|v| *v), 5);
128128
}
129129

130130
#[test]

0 commit comments

Comments
 (0)