summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2019-09-18 10:18:53 +0300
committerLars Wirzenius <liw@liw.fi>2019-09-18 10:18:53 +0300
commitafeeb2276df2907f5db901ddc30ff0ac7f05c84f (patch)
tree1779de7a8a3c7c51157af52d849a2dd63fe28777 /src
parent6cc8825abb6252512941b4e04ef049c5c8d58fdf (diff)
downloadroadmap-afeeb2276df2907f5db901ddc30ff0ac7f05c84f.tar.gz
Change: make struct members private
Diffstat (limited to 'src')
-rw-r--r--src/lib.rs28
1 files changed, 24 insertions, 4 deletions
diff --git a/src/lib.rs b/src/lib.rs
index f8af4e4..c3e740b 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -1,7 +1,7 @@
pub struct Step {
- pub name: String,
- pub label: String,
- pub depends: Vec<String>,
+ name: String,
+ label: String,
+ depends: Vec<String>,
}
impl Step {
@@ -12,10 +12,22 @@ impl Step {
depends: vec![],
}
}
+
+ pub fn name(self) -> String {
+ self.name.to_string()
+ }
+
+ pub fn label(self) -> String {
+ self.label.to_string()
+ }
+
+ pub fn depends(self) -> Vec<String> {
+ self.depends.clone()
+ }
}
pub struct Roadmap {
- pub steps: Vec<Step>,
+ steps: Vec<Step>,
}
impl Roadmap {
@@ -27,6 +39,14 @@ impl Roadmap {
None
}
+ pub fn steps(self) -> Vec<String> {
+ let mut names = vec![];
+ for step in self.steps {
+ names.push(step.name());
+ }
+ names
+ }
+
pub fn get_step(self, _name: &str) -> Option<Step> {
None
}