Skip to content

Commit 573a5e7

Browse files
committed
Remove another FnBox trait
No longer needed on stable!
1 parent be01054 commit 573a5e7

File tree

1 file changed

+2
-12
lines changed

1 file changed

+2
-12
lines changed

src/cargo/core/compiler/job.rs

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,7 @@ pub struct Job {
1212
/// Each proc should send its description before starting.
1313
/// It should send either once or close immediately.
1414
pub struct Work {
15-
inner: Box<dyn for<'a, 'b> FnBox<&'a JobState<'b>, CargoResult<()>> + Send>,
16-
}
17-
18-
trait FnBox<A, R> {
19-
fn call_box(self: Box<Self>, a: A) -> R;
20-
}
21-
22-
impl<A, R, F: FnOnce(A) -> R> FnBox<A, R> for F {
23-
fn call_box(self: Box<F>, a: A) -> R {
24-
(*self)(a)
25-
}
15+
inner: Box<dyn FnOnce(&JobState<'_>) -> CargoResult<()> + Send>,
2616
}
2717

2818
impl Work {
@@ -38,7 +28,7 @@ impl Work {
3828
}
3929

4030
pub fn call(self, tx: &JobState<'_>) -> CargoResult<()> {
41-
self.inner.call_box(tx)
31+
(self.inner)(tx)
4232
}
4333

4434
pub fn then(self, next: Work) -> Work {

0 commit comments

Comments
 (0)