Skip to content

Commit ae04dc8

Browse files
committed
Remove unneccessary use under cfg(unix)
1 parent a06b205 commit ae04dc8

File tree

1 file changed

+2
-12
lines changed

1 file changed

+2
-12
lines changed

src/libtest/helpers/concurrency.rs

+2-12
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,14 @@
22
//! during tests execution.
33
use std::env;
44

5-
#[cfg(any(unix, target_os = "cloudabi"))]
6-
use libc;
7-
85
#[allow(deprecated)]
96
pub fn get_concurrency() -> usize {
107
return match env::var("RUST_TEST_THREADS") {
118
Ok(s) => {
129
let opt_n: Option<usize> = s.parse().ok();
1310
match opt_n {
1411
Some(n) if n > 0 => n,
15-
_ => panic!(
16-
"RUST_TEST_THREADS is `{}`, should be a positive integer.",
17-
s
18-
),
12+
_ => panic!("RUST_TEST_THREADS is `{}`, should be a positive integer.", s),
1913
}
2014
}
2115
Err(..) => num_cpus(),
@@ -82,11 +76,7 @@ pub fn get_concurrency() -> usize {
8276
unsafe { libc::sysconf(libc::_SC_NPROCESSORS_ONLN) as usize }
8377
}
8478

85-
#[cfg(any(
86-
target_os = "freebsd",
87-
target_os = "dragonfly",
88-
target_os = "netbsd"
89-
))]
79+
#[cfg(any(target_os = "freebsd", target_os = "dragonfly", target_os = "netbsd"))]
9080
fn num_cpus() -> usize {
9181
use std::ptr;
9282

0 commit comments

Comments
 (0)