diff options
-rw-r--r-- | src/env.rs | 28 |
1 files changed, 14 insertions, 14 deletions
@@ -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; + } } } |