From 129748773ae3e6021a0429b6a38ea96d21426a79 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Thu, 9 Nov 2017 23:05:45 +0100 Subject: find_and_track_build_and_update_status: Remove `repo_name` argument I just looked at `CommitRef`'s definition and realised that it includes the repo name already. Whoops, turns out we didn't need this. Probably didn't occur to me because I decided not to write a test for `find_and_track_build_and_update_status` since it seemed like too much of a pain. --- src/jenkins.rs | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/jenkins.rs b/src/jenkins.rs index edfb95f..1f51a60 100644 --- a/src/jenkins.rs +++ b/src/jenkins.rs @@ -77,11 +77,8 @@ impl Job { } } -pub fn find_and_track_build_and_update_status( - repo_name: String, - commit_ref: CommitRef -) { - let jobs = get_jobs(repo_name); +pub fn find_and_track_build_and_update_status(commit_ref: CommitRef) { + let jobs = get_jobs(commit_ref.repo.as_ref()); let t20_minutes = 60 * 20; for job_url in jobs { @@ -158,7 +155,7 @@ pub fn auth_credentials() -> Basic { } } -pub fn get_jobs(repo_name: String) -> Vec { +pub fn get_jobs(repo_name: &str) -> Vec { let client = reqwest::Client::new(); let credentials = auth_credentials(); @@ -263,7 +260,7 @@ mod tests { "#) .create(); - let jobs = get_jobs("changes".to_string()); + let jobs = get_jobs("changes"); assert_eq!( jobs, -- cgit v1.2.3