Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ lazy_static = "1.0"
# Used when testing out serde support.
bincode = {version = "1.1.3"}

[build-dependencies]
autocfg = "0.1.6"

[features]
default = []
owning_ref = ["lock_api/owning_ref"]
Expand Down
3 changes: 0 additions & 3 deletions core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@ petgraph = { version = "0.4.5", optional = true }
thread-id = { version = "3.2.0", optional = true }
backtrace = { version = "0.3.2", optional = true }

[build-dependencies]
autocfg = "0.1.6"

[target.'cfg(unix)'.dependencies]
libc = "0.2.55"

Expand Down
20 changes: 10 additions & 10 deletions src/condvar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ pub struct WaitTimeoutResult(bool);
impl WaitTimeoutResult {
/// Returns whether the wait was known to have timed out.
#[inline]
pub fn timed_out(&self) -> bool {
pub fn timed_out(self) -> bool {
self.0
}
}
Expand Down Expand Up @@ -618,7 +618,7 @@ mod tests {
rx.recv().unwrap();
let _g = m.lock();
let _guard = PanicGuard(&*c);
let _ = c.wait(&mut m3.lock());
c.wait(&mut m3.lock());
}

#[test]
Expand Down Expand Up @@ -917,7 +917,7 @@ mod webkit_queue_test {
num_producers: 1,
num_consumers: 1,
max_queue_size: 1,
messages_per_producer: 100000,
messages_per_producer: 100_000,
notification_style: NotifyStyle::All,
timeout: Timeout::Bounded(Duration::from_secs(1)),
delay_seconds: 0
Expand All @@ -926,7 +926,7 @@ mod webkit_queue_test {
num_producers: 1,
num_consumers: 1,
max_queue_size: 1,
messages_per_producer: 100000,
messages_per_producer: 100_000,
notification_style: NotifyStyle::All,
timeout: Timeout::Forever,
delay_seconds: 0
Expand All @@ -935,7 +935,7 @@ mod webkit_queue_test {
num_producers: 1,
num_consumers: 5,
max_queue_size: 1,
messages_per_producer: 100000,
messages_per_producer: 100_000,
notification_style: NotifyStyle::All,
timeout: Timeout::Forever,
delay_seconds: 0
Expand All @@ -944,7 +944,7 @@ mod webkit_queue_test {
num_producers: 1,
num_consumers: 1,
max_queue_size: 1,
messages_per_producer: 100000,
messages_per_producer: 100_000,
notification_style: NotifyStyle::All,
timeout: Timeout::Forever,
delay_seconds: 0
Expand All @@ -953,7 +953,7 @@ mod webkit_queue_test {
num_producers: 1,
num_consumers: 1,
max_queue_size: 1,
messages_per_producer: 100000,
messages_per_producer: 100_000,
notification_style: NotifyStyle::All,
timeout: Timeout::Forever,
delay_seconds: 1
Expand All @@ -962,7 +962,7 @@ mod webkit_queue_test {
num_producers: 1,
num_consumers: 1,
max_queue_size: 100,
messages_per_producer: 1000000,
messages_per_producer: 1_000_000,
notification_style: NotifyStyle::All,
timeout: Timeout::Forever,
delay_seconds: 0
Expand Down Expand Up @@ -1007,7 +1007,7 @@ mod webkit_queue_test {
num_producers: 1,
num_consumers: 10,
max_queue_size: 100,
messages_per_producer: 100000,
messages_per_producer: 100_000,
notification_style: NotifyStyle::All,
timeout: Timeout::Forever,
delay_seconds: 0
Expand All @@ -1016,7 +1016,7 @@ mod webkit_queue_test {
num_producers: 1,
num_consumers: 10,
max_queue_size: 100,
messages_per_producer: 100000,
messages_per_producer: 100_000,
notification_style: NotifyStyle::One,
timeout: Timeout::Forever,
delay_seconds: 0
Expand Down
2 changes: 1 addition & 1 deletion src/mutex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ mod tests {
fn test_mutex_arc_access_in_unwind() {
let arc = Arc::new(Mutex::new(1));
let arc2 = arc.clone();
let _ = thread::spawn(move || -> () {
let _ = thread::spawn(move || {
struct Unwinder {
i: Arc<Mutex<i32>>,
}
Expand Down
8 changes: 4 additions & 4 deletions src/once.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ impl OnceState {
/// Once an initialization routine for a `Once` has panicked it will forever
/// indicate to future forced initialization routines that it is poisoned.
#[inline]
pub fn poisoned(&self) -> bool {
match *self {
pub fn poisoned(self) -> bool {
match self {
OnceState::Poisoned => true,
_ => false,
}
Expand All @@ -49,8 +49,8 @@ impl OnceState {
/// Returns whether the associated `Once` has successfully executed a
/// closure.
#[inline]
pub fn done(&self) -> bool {
match *self {
pub fn done(self) -> bool {
match self {
OnceState::Done => true,
_ => false,
}
Expand Down
8 changes: 4 additions & 4 deletions src/remutex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,18 +69,18 @@ mod tests {

#[test]
fn smoke() {
let m = ReentrantMutex::new(());
let m = ReentrantMutex::new(2);
{
let a = m.lock();
{
let b = m.lock();
{
let c = m.lock();
assert_eq!(*c, ());
assert_eq!(*c, 2);
}
assert_eq!(*b, ());
assert_eq!(*b, 2);
}
assert_eq!(*a, ());
assert_eq!(*a, 2);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/rwlock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ mod tests {
fn test_rw_arc_access_in_unwind() {
let arc = Arc::new(RwLock::new(1));
let arc2 = arc.clone();
let _ = thread::spawn(move || -> () {
let _ = thread::spawn(move || {
struct Unwinder {
i: Arc<RwLock<isize>>,
}
Expand Down