associated types ftw thanks gustav
This commit is contained in:
parent
d559383737
commit
6abdbb5597
|
@ -60,7 +60,9 @@ struct BuildWorker {
|
|||
}
|
||||
|
||||
impl worker::SimpleWorker for BuildWorker {
|
||||
fn consumer<BuildJob>(&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())?;
|
||||
|
|
|
@ -23,7 +23,8 @@ pub struct Actions {
|
|||
}
|
||||
|
||||
pub trait SimpleWorker {
|
||||
fn consumer<J>(&self, job: J, resp: Actions) -> Result<(), Error>;
|
||||
type J;
|
||||
fn consumer(&self, job: Self::J, resp: Actions) -> Result<(), Error>;
|
||||
}
|
||||
|
||||
pub fn new<T: SimpleWorker>(worker: T) -> Worker<T> {
|
||||
|
|
Loading…
Reference in a new issue