aboutsummaryrefslogtreecommitdiffstats
path: root/src/jenkins.rs
diff options
context:
space:
mode:
authorTeddy Wing2017-11-09 23:05:45 +0100
committerTeddy Wing2017-11-09 23:08:22 +0100
commit129748773ae3e6021a0429b6a38ea96d21426a79 (patch)
tree9cc1f863b2e3986f7c34aebbfa2dab2f540a0ecf /src/jenkins.rs
parent7e5c0754be6178ab6ad44a3d3c787f5494065742 (diff)
downloadkipper-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.
Diffstat (limited to 'src/jenkins.rs')
-rw-r--r--src/jenkins.rs11
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,