diff options
author | Teddy Wing | 2017-11-12 20:12:25 +0100 |
---|---|---|
committer | Teddy Wing | 2017-11-12 20:12:25 +0100 |
commit | 98ff2f8a24f0d32043b4de9b5671a4d882a6e903 (patch) | |
tree | 4253c86b7a10594e7ed0e31ec2a811795ca64e7a /src/jenkins.rs | |
parent | aeba798c8e3f242c845e3d36966249ab9a914efc (diff) | |
download | kipper-98ff2f8a24f0d32043b4de9b5671a4d882a6e903.tar.bz2 |
request_job(): Use `Job::new()`
Realised that the reason why I was getting a dead code warning from
`Job::new` was not just because I wasn't using it, but because I was
meant to use it somewhere. Remove the duplicate work going on in
`request_job()` and replace it with a call to `Job::new()` instead.
Diffstat (limited to 'src/jenkins.rs')
-rw-r--r-- | src/jenkins.rs | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/src/jenkins.rs b/src/jenkins.rs index a41b11c..f2da0d2 100644 --- a/src/jenkins.rs +++ b/src/jenkins.rs @@ -238,14 +238,9 @@ pub fn request_job( let body = response.text()?; - let mut job = json::parse(body.as_ref())?; + let job = Job::new(body)?; - Ok( - Job { - display_name: job["displayName"].take_string().unwrap_or_default(), - result: result_from_job(job["result"].take_string()), - } - ) + Ok(job) } // Does the `commit_ref` correspond to the job? |