From 087ff5c8bd0b7364101580e9be3069ef40ce91b1 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Thu, 21 Jan 2021 16:07:28 +0100 Subject: Fix clippy: Do not clone() copy type Signed-off-by: Matthias Beyer --- src/job/runnable.rs | 2 +- src/job/tree.rs | 2 +- src/orchestrator/orchestrator.rs | 5 ++--- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/job/runnable.rs b/src/job/runnable.rs index a7ddb52..7bfabae 100644 --- a/src/job/runnable.rs +++ b/src/job/runnable.rs @@ -101,7 +101,7 @@ impl RunnableJob { )?; Ok(RunnableJob { - uuid: job.uuid.clone(), + uuid: job.uuid, package: job.package.clone(), image: job.image.clone(), resources, diff --git a/src/job/tree.rs b/src/job/tree.rs index 883d93e..d7c0751 100644 --- a/src/job/tree.rs +++ b/src/job/tree.rs @@ -59,7 +59,7 @@ impl Tree { phases.clone(), resources.clone()); - let job_uuid = job.uuid().clone(); + let job_uuid = *job.uuid(); let jdef = JobDefinition { job, dependencies: deps_uuids }; tree.insert(job_uuid, jdef); diff --git a/src/orchestrator/orchestrator.rs b/src/orchestrator/orchestrator.rs index 135e10c..e637f36 100644 --- a/src/orchestrator/orchestrator.rs +++ b/src/orchestrator/orchestrator.rs @@ -131,8 +131,7 @@ impl<'a> Orchestrator<'a> { .map(|(uuid, jobdef)| { trace!("Running job {}", uuid); let bar = multibar.add(self.progress_generator.bar()); - let uuid = uuid.clone(); - self.run_job(jobdef, bar).map(move |r| (uuid, r)) + self.run_job(jobdef, bar).map(move |r| (*uuid, r)) }) .collect::>() .collect::)>>(); @@ -181,7 +180,7 @@ impl<'a> Orchestrator<'a> { .await?; bar.set_message("Scheduling..."); - let job_uuid = jobdef.job.uuid().clone(); + let job_uuid = *jobdef.job.uuid(); match self.scheduler.schedule_job(runnable, bar).await?.run().await { Err(e) => return Ok(Err((job_uuid, e))), Ok(db_artifacts) => { -- cgit v1.2.3