From b8ca85eb61a362fd95bbc6c5354d881032da12c4 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Fri, 4 Oct 2019 10:03:08 +0300 Subject: Change: make Status copiable, don't pass references Status is very small, so copying it is just easier than dealing with references. --- src/map.rs | 4 ++-- src/status.rs | 2 +- src/step.rs | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/map.rs b/src/map.rs index a5a1b77..979abdb 100644 --- a/src/map.rs +++ b/src/map.rs @@ -98,13 +98,13 @@ impl Roadmap { } // Return vector of all statuses of all dependencies - fn dep_statuses(&self, step: &Step) -> Vec<&Status> { + fn dep_statuses(&self, step: &Step) -> Vec { step.dependencies() .map(|depname| { if let Some(step) = self.get_step(depname) { step.status() } else { - &Status::Unknown + Status::Unknown } }) .collect() diff --git a/src/status.rs b/src/status.rs index e6bac17..2edfbd1 100644 --- a/src/status.rs +++ b/src/status.rs @@ -5,7 +5,7 @@ /// example, a step is inferred to be blocked if any of it /// dependencies are not finished. -#[derive(Clone, Debug, PartialEq)] +#[derive(Clone, Copy, Debug, PartialEq)] pub enum Status { Unknown, Goal, diff --git a/src/step.rs b/src/step.rs index e8d9117..aae69ff 100644 --- a/src/step.rs +++ b/src/step.rs @@ -35,8 +35,8 @@ impl Step { } /// Return the status of a step. - pub fn status<'a>(&'a self) -> &Status { - &self.status + pub fn status<'a>(&'a self) -> Status { + self.status } /// Set the status of a step. -- cgit v1.2.1