diff --git a/ofborg/src/bin/builder.rs b/ofborg/src/bin/builder.rs index 59e1797..18b1308 100644 --- a/ofborg/src/bin/builder.rs +++ b/ofborg/src/bin/builder.rs @@ -60,7 +60,9 @@ struct BuildWorker { } impl worker::SimpleWorker for BuildWorker { - fn consumer(&self, job: BuildJob, resp: Actions) -> Result<(), Error> { + type J = BuildJob; + + fn consumer(&self, job: BuildJob, resp: Actions) -> Result<(), Error> { let project = self.cloner.project(job.repo.full_name, job.repo.clone_url); let co = project.clone_for("builder".to_string(), job.pr.number.to_string())?; diff --git a/ofborg/src/worker.rs b/ofborg/src/worker.rs index f3586c8..d7ce25d 100644 --- a/ofborg/src/worker.rs +++ b/ofborg/src/worker.rs @@ -23,7 +23,8 @@ pub struct Actions { } pub trait SimpleWorker { - fn consumer(&self, job: J, resp: Actions) -> Result<(), Error>; + type J; + fn consumer(&self, job: Self::J, resp: Actions) -> Result<(), Error>; } pub fn new(worker: T) -> Worker {