[3/5] jenkins: Rename JenkinsBuildStatus to BuildStatus
diff mbox series

Message ID 20190201061714.7110-3-andrew.donnellan@au1.ibm.com
State Accepted
Headers show
Series
  • [1/5] Formatting cleanups
Related show

Commit Message

Andrew Donnellan Feb. 1, 2019, 6:17 a.m. UTC
There's no reason JenkinsBuildStatus needs to be Jenkins-specific at the
moment.

Signed-off-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>
---
 src/jenkins.rs | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

Patch
diff mbox series

diff --git a/src/jenkins.rs b/src/jenkins.rs
index 547c396c3513..c76561f1fda2 100644
--- a/src/jenkins.rs
+++ b/src/jenkins.rs
@@ -86,7 +86,7 @@  impl CIBackend for JenkinsBackend {
 }
 
 #[derive(Eq, PartialEq)]
-pub enum JenkinsBuildStatus {
+pub enum BuildStatus {
     Running,
     Done,
 }
@@ -166,10 +166,10 @@  impl JenkinsBackend {
         }
     }
 
-    pub fn get_build_status(&self, build_handle: &str) -> Result<JenkinsBuildStatus, Box<Error>> {
+    pub fn get_build_status(&self, build_handle: &str) -> Result<BuildStatus, Box<Error>> {
         match self.get_api_json_object(build_handle)?["building"].as_bool() {
-            Some(true) => Ok(JenkinsBuildStatus::Running),
-            Some(false) => Ok(JenkinsBuildStatus::Done),
+            Some(true) => Ok(BuildStatus::Running),
+            Some(false) => Ok(BuildStatus::Done),
             None => Err("Error getting build status".into()),
         }
     }
@@ -230,11 +230,11 @@  impl JenkinsBackend {
         }
     }
 
-    pub fn wait_build(&self, build_handle: &str) -> Result<JenkinsBuildStatus, Box<Error>> {
+    pub fn wait_build(&self, build_handle: &str) -> Result<BuildStatus, Box<Error>> {
         // TODO: Implement a timeout?
-        while self.get_build_status(build_handle)? != JenkinsBuildStatus::Done {
+        while self.get_build_status(build_handle)? != BuildStatus::Done {
             sleep(Duration::from_millis(JENKINS_POLLING_INTERVAL));
         }
-        Ok(JenkinsBuildStatus::Done)
+        Ok(BuildStatus::Done)
     }
 }