From 274f22abbd33e083b52fc5ade828050b61a22f85 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Fri, 10 Nov 2017 02:29:13 +0100 Subject: 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. --- src/jenkins.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') 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; } }); -- cgit v1.2.3