Skip to content

Commit 4b09228

Browse files
committed
---
yaml --- r: 146775 b: refs/heads/try2 c: bb39cc3 h: refs/heads/master i: 146773: 2b26ab0 146771: a9f1d5a 146767: 75bb624 v: v3
1 parent 27623d5 commit 4b09228

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: 2e4bb2b9e9e10a665e23a34ae60652a90e9a1b82
8+
refs/heads/try2: bb39cc3ae6db7effb17902d0cff0a737aef15101
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/src/libstd/mutable.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -82,30 +82,30 @@ impl<T> Mut<T> {
8282

8383
/// Mutably borrows the wrapped value.
8484
///
85-
/// The borrow lasts untile the returned `MutRef` exits scope. The value
85+
/// The borrow lasts untile the returned `RefMut` exits scope. The value
8686
/// cannot be borrowed while this borrow is active.
8787
///
8888
/// 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>> {
9090
match self.borrow {
9191
UNUSED => unsafe {
9292
let mut_self = self.as_mut();
9393
mut_self.borrow = WRITING;
94-
Some(MutRef { parent: mut_self })
94+
Some(RefMut { parent: mut_self })
9595
},
9696
_ => None
9797
}
9898
}
9999

100100
/// Mutably borrows the wrapped value.
101101
///
102-
/// The borrow lasts untile the returned `MutRef` exits scope. The value
102+
/// The borrow lasts untile the returned `RefMut` exits scope. The value
103103
/// cannot be borrowed while this borrow is active.
104104
///
105105
/// # Failure
106106
///
107107
/// 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> {
109109
match self.try_borrow_mut() {
110110
Some(ptr) => ptr,
111111
None => fail!("Mut<T> already borrowed")
@@ -179,19 +179,19 @@ impl<'box, T> Ref<'box, T> {
179179
}
180180

181181
/// Wraps a mutable borrowed reference to a value in a `Mut` box.
182-
pub struct MutRef<'box, T> {
182+
pub struct RefMut<'box, T> {
183183
priv parent: &'box mut Mut<T>
184184
}
185185

186186
#[unsafe_destructor]
187-
impl<'box, T> Drop for MutRef<'box, T> {
187+
impl<'box, T> Drop for RefMut<'box, T> {
188188
fn drop(&mut self) {
189189
assert!(self.parent.borrow == WRITING);
190-
unsafe { self.parent.as_mut().borrow = UNUSED; }
190+
self.parent.borrow = UNUSED;
191191
}
192192
}
193193

194-
impl<'box, T> MutRef<'box, T> {
194+
impl<'box, T> RefMut<'box, T> {
195195
/// Retrieve a mutable reference to the stored value.
196196
#[inline]
197197
pub fn get<'a>(&'a mut self) -> &'a mut T {

0 commit comments

Comments
 (0)