summaryrefslogtreecommitdiffstats
path: root/src/env.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/env.rs')
-rw-r--r--src/env.rs28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/env.rs b/src/env.rs
index 1708c06..c6a4056 100644
--- a/src/env.rs
+++ b/src/env.rs
@@ -28,6 +28,12 @@ impl Env {
})
}
+ pub fn pipeline(&self) -> Option<&str> {
+ match self {
+ Self::V0(env) => env.pipeline.as_deref(),
+ }
+ }
+
pub fn set_pipeline(&mut self, pipeline: String) {
match self {
Self::V0(env) => {
@@ -48,18 +54,16 @@ impl Env {
}
}
- pub fn set_status(&mut self, status: async_std::process::ExitStatus) {
+ pub fn latest_status(&self) -> &async_std::process::ExitStatus {
match self {
- Self::V0(env) => {
- env.latest_status = status;
- }
+ Self::V0(env) => &env.latest_status,
}
}
- pub fn set_current_dir(&mut self, pwd: std::path::PathBuf) {
+ pub fn set_status(&mut self, status: async_std::process::ExitStatus) {
match self {
Self::V0(env) => {
- env.pwd = pwd;
+ env.latest_status = status;
}
}
}
@@ -70,15 +74,11 @@ impl Env {
}
}
- pub fn pipeline(&self) -> Option<&str> {
- match self {
- Self::V0(env) => env.pipeline.as_deref(),
- }
- }
-
- pub fn latest_status(&self) -> &async_std::process::ExitStatus {
+ pub fn set_current_dir(&mut self, pwd: std::path::PathBuf) {
match self {
- Self::V0(env) => &env.latest_status,
+ Self::V0(env) => {
+ env.pwd = pwd;
+ }
}
}