Skip to content

Commit c5b4768

Browse files
committed
Migrate to the 2018 edition
1 parent 6ba4573 commit c5b4768

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ documentation = "https://docs.rs/jobserver"
99
description = """
1010
An implementation of the GNU make jobserver for Rust
1111
"""
12+
edition = "2018"
1213

1314
[target.'cfg(unix)'.dependencies]
1415
libc = "0.2.50"

src/lib.rs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,6 @@ mod imp {
482482
use std::os::unix::prelude::*;
483483
use std::process::Command;
484484
use std::ptr;
485-
use std::sync::atomic::{AtomicBool, Ordering};
486485
use std::sync::{Arc, Once};
487486
use std::thread::{self, Builder, JoinHandle};
488487
use std::time::Duration;
@@ -678,9 +677,9 @@ mod imp {
678677
}
679678

680679
pub(crate) fn spawn_helper(
681-
client: ::Client,
680+
client: crate::Client,
682681
state: Arc<super::HelperState>,
683-
mut f: Box<dyn FnMut(io::Result<::Acquired>) + Send>,
682+
mut f: Box<dyn FnMut(io::Result<crate::Acquired>) + Send>,
684683
) -> io::Result<Helper> {
685684
static USR1_INIT: Once = Once::new();
686685
let mut err = None;
@@ -996,9 +995,9 @@ mod imp {
996995
}
997996

998997
pub(crate) fn spawn_helper(
999-
client: ::Client,
998+
client: crate::Client,
1000999
state: Arc<super::HelperState>,
1001-
mut f: Box<dyn FnMut(io::Result<::Acquired>) + Send>,
1000+
mut f: Box<dyn FnMut(io::Result<crate::Acquired>) + Send>,
10021001
) -> io::Result<Helper> {
10031002
let event = unsafe {
10041003
let r = CreateEventA(ptr::null_mut(), TRUE, FALSE, ptr::null());
@@ -1016,7 +1015,7 @@ mod imp {
10161015
const WAIT_OBJECT_1: u32 = WAIT_OBJECT_0 + 1;
10171016
match unsafe { WaitForMultipleObjects(2, objects.as_ptr(), FALSE, INFINITE) } {
10181017
WAIT_OBJECT_0 => return,
1019-
WAIT_OBJECT_1 => f(Ok(::Acquired {
1018+
WAIT_OBJECT_1 => f(Ok(crate::Acquired {
10201019
client: client.inner.clone(),
10211020
data: Acquired,
10221021
disabled: false,
@@ -1119,9 +1118,9 @@ mod imp {
11191118
}
11201119

11211120
pub(crate) fn spawn_helper(
1122-
client: ::Client,
1121+
client: crate::Client,
11231122
state: Arc<super::HelperState>,
1124-
mut f: Box<dyn FnMut(io::Result<::Acquired>) + Send>,
1123+
mut f: Box<dyn FnMut(io::Result<crate::Acquired>) + Send>,
11251124
) -> io::Result<Helper> {
11261125
let thread = Builder::new().spawn(move || {
11271126
state.for_each_request(|| f(client.acquire()));

tests/client.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ macro_rules! t {
3232

3333
struct Test {
3434
name: &'static str,
35-
f: &'static Fn(),
35+
f: &'static dyn Fn(),
3636
make_args: &'static [&'static str],
37-
rule: &'static Fn(&str) -> String,
37+
rule: &'static dyn Fn(&str) -> String,
3838
}
3939

4040
const TESTS: &[Test] = &[

0 commit comments

Comments
 (0)