aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTeddy Wing2017-11-10 02:29:13 +0100
committerTeddy Wing2017-11-10 02:29:13 +0100
commit274f22abbd33e083b52fc5ade828050b61a22f85 (patch)
tree16def4d4c67fcf4a4931b8063feab7990e356488 /src
parentfe47473ca07578e22fdd28bdb9a7531c63a2ef0a (diff)
downloadkipper-274f22abbd33e083b52fc5ade828050b61a22f85.tar.bz2
find_and_track_build_and_update_status(): Fix `while` loop
I got an unused variable warning on line 142 when I "reset" job at the end of the loop. But actually, I wasn't resetting it, I was creating a new variable in the inner scope. In order to update the `job` used by the `while` loop, I think we need to make `job` a mutable variable and then set it at the end of the loop.
Diffstat (limited to 'src')
-rw-r--r--src/jenkins.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/jenkins.rs b/src/jenkins.rs
index 0ccc238..9ad39d5 100644
--- a/src/jenkins.rs
+++ b/src/jenkins.rs
@@ -82,7 +82,7 @@ pub fn find_and_track_build_and_update_status(commit_ref: CommitRef) {
let t20_minutes = 60 * 20;
for job_url in jobs {
- let job = request_job(job_url.as_ref());
+ let mut job = request_job(job_url.as_ref());
// Does `displayName` match
if job_for_commit(&job, &commit_ref) {
@@ -139,7 +139,7 @@ pub fn find_and_track_build_and_update_status(commit_ref: CommitRef) {
return
}
- let job = updated_job;
+ job = updated_job;
}
});