summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2019-10-04 10:03:08 +0300
committerLars Wirzenius <liw@liw.fi>2019-10-04 10:03:08 +0300
commitb8ca85eb61a362fd95bbc6c5354d881032da12c4 (patch)
treef6144aa5a3015b6719198d7800205f380088ca33 /src
parentba9b4d27d1ba6489b0be9c97a0ebb7739bc8f635 (diff)
downloadroadmap-b8ca85eb61a362fd95bbc6c5354d881032da12c4.tar.gz
Change: make Status copiable, don't pass references
Status is very small, so copying it is just easier than dealing with references.
Diffstat (limited to 'src')
-rw-r--r--src/map.rs4
-rw-r--r--src/status.rs2
-rw-r--r--src/step.rs4
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<Status> {
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.