Skip to content

Commit b9bc431

Browse files
committed
Rename serial_join and serial_scope to join and scope
1 parent 8356022 commit b9bc431

File tree

1 file changed

+22
-25
lines changed
  • src/librustc_data_structures

1 file changed

+22
-25
lines changed

src/librustc_data_structures/sync.rs

+22-25
Original file line numberDiff line numberDiff line change
@@ -41,29 +41,6 @@ cfg_if! {
4141
}
4242
}
4343

44-
pub fn serial_join<A, B, RA, RB>(oper_a: A, oper_b: B) -> (RA, RB)
45-
where A: FnOnce() -> RA,
46-
B: FnOnce() -> RB
47-
{
48-
(oper_a(), oper_b())
49-
}
50-
51-
pub struct SerialScope;
52-
53-
impl SerialScope {
54-
pub fn spawn<F>(&self, f: F)
55-
where F: FnOnce(&SerialScope)
56-
{
57-
f(self)
58-
}
59-
}
60-
61-
pub fn serial_scope<F, R>(f: F) -> R
62-
where F: FnOnce(&SerialScope) -> R
63-
{
64-
f(&SerialScope)
65-
}
66-
6744
use std::ops::Add;
6845
use std::panic::{resume_unwind, catch_unwind, AssertUnwindSafe};
6946

@@ -176,8 +153,28 @@ cfg_if! {
176153
pub type AtomicU32 = Atomic<u32>;
177154
pub type AtomicU64 = Atomic<u64>;
178155

179-
pub use self::serial_join as join;
180-
pub use self::serial_scope as scope;
156+
pub fn join<A, B, RA, RB>(oper_a: A, oper_b: B) -> (RA, RB)
157+
where A: FnOnce() -> RA,
158+
B: FnOnce() -> RB
159+
{
160+
(oper_a(), oper_b())
161+
}
162+
163+
pub struct SerialScope;
164+
165+
impl SerialScope {
166+
pub fn spawn<F>(&self, f: F)
167+
where F: FnOnce(&SerialScope)
168+
{
169+
f(self)
170+
}
171+
}
172+
173+
pub fn scope<F, R>(f: F) -> R
174+
where F: FnOnce(&SerialScope) -> R
175+
{
176+
f(&SerialScope)
177+
}
181178

182179
#[macro_export]
183180
macro_rules! parallel {

0 commit comments

Comments
 (0)