@@ -82,30 +82,30 @@ impl<T> Mut<T> {
82
82
83
83
/// Mutably borrows the wrapped value.
84
84
///
85
- /// The borrow lasts untile the returned `MutRef ` exits scope. The value
85
+ /// The borrow lasts untile the returned `RefMut ` exits scope. The value
86
86
/// cannot be borrowed while this borrow is active.
87
87
///
88
88
/// Returns `None` if the value is currently borrowed.
89
- pub fn try_borrow_mut < ' a > ( & ' a self ) -> Option < MutRef < ' a , T > > {
89
+ pub fn try_borrow_mut < ' a > ( & ' a self ) -> Option < RefMut < ' a , T > > {
90
90
match self . borrow {
91
91
UNUSED => unsafe {
92
92
let mut_self = self . as_mut ( ) ;
93
93
mut_self. borrow = WRITING ;
94
- Some ( MutRef { parent : mut_self } )
94
+ Some ( RefMut { parent : mut_self } )
95
95
} ,
96
96
_ => None
97
97
}
98
98
}
99
99
100
100
/// Mutably borrows the wrapped value.
101
101
///
102
- /// The borrow lasts untile the returned `MutRef ` exits scope. The value
102
+ /// The borrow lasts untile the returned `RefMut ` exits scope. The value
103
103
/// cannot be borrowed while this borrow is active.
104
104
///
105
105
/// # Failure
106
106
///
107
107
/// Fails if the value is currently borrowed.
108
- pub fn borrow_mut < ' a > ( & ' a self ) -> MutRef < ' a , T > {
108
+ pub fn borrow_mut < ' a > ( & ' a self ) -> RefMut < ' a , T > {
109
109
match self . try_borrow_mut ( ) {
110
110
Some ( ptr) => ptr,
111
111
None => fail ! ( "Mut<T> already borrowed" )
@@ -179,19 +179,19 @@ impl<'box, T> Ref<'box, T> {
179
179
}
180
180
181
181
/// Wraps a mutable borrowed reference to a value in a `Mut` box.
182
- pub struct MutRef < ' box , T > {
182
+ pub struct RefMut < ' box , T > {
183
183
priv parent : & ' box mut Mut < T >
184
184
}
185
185
186
186
#[ unsafe_destructor]
187
- impl < ' box , T > Drop for MutRef < ' box , T > {
187
+ impl < ' box , T > Drop for RefMut < ' box , T > {
188
188
fn drop ( & mut self ) {
189
189
assert ! ( self . parent. borrow == WRITING ) ;
190
- unsafe { self . parent . as_mut ( ) . borrow = UNUSED ; }
190
+ self . parent . borrow = UNUSED ;
191
191
}
192
192
}
193
193
194
- impl < ' box , T > MutRef < ' box , T > {
194
+ impl < ' box , T > RefMut < ' box , T > {
195
195
/// Retrieve a mutable reference to the stored value.
196
196
#[ inline]
197
197
pub fn get < ' a > ( & ' a mut self ) -> & ' a mut T {
0 commit comments