Skip to content

Commit 2490b59

Browse files
committed
Remove unneccessary mut from arc
1 parent 7a1e486 commit 2490b59

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/libextra/arc.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ use std::borrow;
5151
/// As sync::condvar, a mechanism for unlock-and-descheduling and signaling.
5252
pub struct Condvar<'a> {
5353
priv is_mutex: bool,
54-
priv failed: &'a mut bool,
54+
priv failed: &'a bool,
5555
priv cond: &'a sync::Condvar<'a>
5656
}
5757

@@ -242,7 +242,7 @@ impl<T:Send> MutexArc<T> {
242242
let _z = PoisonOnFail::new(&mut (*state).failed);
243243
blk(&mut (*state).data,
244244
&Condvar {is_mutex: true,
245-
failed: &mut (*state).failed,
245+
failed: &(*state).failed,
246246
cond: cond })
247247
})
248248
}
@@ -414,7 +414,7 @@ impl<T:Freeze + Send> RWArc<T> {
414414
let _z = PoisonOnFail::new(&mut (*state).failed);
415415
blk(&mut (*state).data,
416416
&Condvar {is_mutex: false,
417-
failed: &mut (*state).failed,
417+
failed: &(*state).failed,
418418
cond: cond})
419419
})
420420
}
@@ -567,7 +567,7 @@ impl<'a, T:Freeze + Send> RWWriteMode<'a, T> {
567567
unsafe {
568568
let cvar = Condvar {
569569
is_mutex: false,
570-
failed: &mut *poison.flag,
570+
failed: &*poison.flag,
571571
cond: cond
572572
};
573573
blk(data, &cvar)

0 commit comments

Comments
 (0)