diff options
| author | Teddy Wing | 2017-11-09 23:05:45 +0100 | 
|---|---|---|
| committer | Teddy Wing | 2017-11-09 23:08:22 +0100 | 
| commit | 129748773ae3e6021a0429b6a38ea96d21426a79 (patch) | |
| tree | 9cc1f863b2e3986f7c34aebbfa2dab2f540a0ecf | |
| parent | 7e5c0754be6178ab6ad44a3d3c787f5494065742 (diff) | |
| download | kipper-129748773ae3e6021a0429b6a38ea96d21426a79.tar.bz2 | |
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.
| -rw-r--r-- | src/jenkins.rs | 11 | 
1 files changed, 4 insertions, 7 deletions
| 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<String> { +pub fn get_jobs(repo_name: &str) -> Vec<String> {      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, | 
