diff options
author | Jesse Luehrs <doy@tozt.net> | 2022-01-05 06:11:14 -0500 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2022-01-05 06:11:14 -0500 |
commit | f97c276722fda4fe12d81041706ea5c7753eb0e2 (patch) | |
tree | aeb7a586f719e086b39861b1a5026cef69b24e7a /src/env.rs | |
parent | c02e122fbf43d109b11acfb32508340be95d51d1 (diff) | |
download | nbsh-f97c276722fda4fe12d81041706ea5c7753eb0e2.tar.gz nbsh-f97c276722fda4fe12d81041706ea5c7753eb0e2.zip |
clean up a bit
Diffstat (limited to 'src/env.rs')
-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; + } } } |