Skip to content

Commit d5e2cd2

Browse files
committed
---
yaml --- r: 93823 b: refs/heads/try c: bb39cc3 h: refs/heads/master i: 93821: a615362 93819: d57704a 93815: 00f7bae 93807: 9163ef8 93791: f1e1257 93759: 7b39f12 93695: 8480120 v: v3
1 parent 35c0ccd commit d5e2cd2

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
@@ -2,7 +2,7 @@
22
refs/heads/master: 0da105a8b7b6b1e0568e8ff20f6ff4b13cc7ecc2
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: a6d3e57dca68fde4effdda3e4ae2887aa535fcd6
5-
refs/heads/try: 2e4bb2b9e9e10a665e23a34ae60652a90e9a1b82
5+
refs/heads/try: bb39cc3ae6db7effb17902d0cff0a737aef15101
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/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)