summaryrefslogtreecommitdiffstats
path: root/src/env.rs
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2022-01-05 06:11:14 -0500
committerJesse Luehrs <doy@tozt.net>2022-01-05 06:11:14 -0500
commitf97c276722fda4fe12d81041706ea5c7753eb0e2 (patch)
treeaeb7a586f719e086b39861b1a5026cef69b24e7a /src/env.rs
parentc02e122fbf43d109b11acfb32508340be95d51d1 (diff)
downloadnbsh-f97c276722fda4fe12d81041706ea5c7753eb0e2.tar.gz
nbsh-f97c276722fda4fe12d81041706ea5c7753eb0e2.zip
clean up a bit
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;
+ }
}
}