File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -105,26 +105,26 @@ impl<T> Drop for Rc<T> {
105
105
#[ cfg( test) ]
106
106
mod test_rc {
107
107
use super :: * ;
108
- use cell :: Cell ;
108
+ use mutable :: Mut ;
109
109
110
110
#[ test]
111
111
fn test_clone( ) {
112
- let x = Rc :: from_send ( Cell :: new ( 5 ) ) ;
112
+ let x = Rc :: from_send ( Mut :: new ( 5 ) ) ;
113
113
let y = x. clone ( ) ;
114
- do x. borrow ( ) . with_mut_ref |inner| {
114
+ do x. borrow ( ) . map_mut |inner| {
115
115
* inner = 20 ;
116
116
}
117
- assert_eq ! ( y. borrow( ) . take ( ) , 20 ) ;
117
+ assert_eq ! ( y. borrow( ) . map ( |v| * v ) , 20 ) ;
118
118
}
119
119
120
120
#[ test]
121
121
fn test_deep_clone( ) {
122
- let x = Rc :: from_send ( Cell :: new ( 5 ) ) ;
122
+ let x = Rc :: from_send ( Mut :: new ( 5 ) ) ;
123
123
let y = x. deep_clone ( ) ;
124
- do x. borrow ( ) . with_mut_ref |inner| {
124
+ do x. borrow ( ) . map_mut |inner| {
125
125
* inner = 20 ;
126
126
}
127
- assert_eq ! ( y. borrow( ) . take ( ) , 5 ) ;
127
+ assert_eq ! ( y. borrow( ) . map ( |v| * v ) , 5 ) ;
128
128
}
129
129
130
130
#[ test]
You can’t perform that action at this time.
0 commit comments