Skip to content

Commit 9649cff

Browse files
author
l
committed
remove taking ownership from sprint vec iter
1 parent 6b28e2f commit 9649cff

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

src/bin/pr-metadata-validator.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ async fn validate_pr(
252252
}
253253

254254
let pr_assignment_descriptor_id =
255-
get_descriptor_id_for_pr(matched.sprints, pr_number).expect("This PR does not exist");
255+
get_descriptor_id_for_pr(&matched.sprints, pr_number).expect("This PR does not exist");
256256
// This should never error, as a PR by this point in code must have been matched
257257
// with an assignment, and PR assignments must have an associated issue descriptor
258258

src/course.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1021,12 +1021,12 @@ fn match_pr_to_assignment(
10211021
// Given a vector of sprints, and a target pr number, for a given person
10221022
// return the issue ID for the associated assignment descriptor
10231023
pub fn get_descriptor_id_for_pr(
1024-
sprints: Vec<SprintWithSubmissions>,
1024+
sprints: &[SprintWithSubmissions],
10251025
target_pr_number: u64,
10261026
) -> Option<u64> {
10271027
match sprints
10281028
.iter()
1029-
.flat_map(|sprint_with_subs| sprint_with_subs.submissions.clone())
1029+
.flat_map(|sprint_with_subs| sprint_with_subs.submissions.iter())
10301030
.filter_map(|missing_or_submission| match missing_or_submission {
10311031
SubmissionState::Some(s) => Some(s),
10321032
_ => None,
@@ -1038,7 +1038,7 @@ pub fn get_descriptor_id_for_pr(
10381038
Some(Submission::PullRequest {
10391039
assignment_issue_id,
10401040
..
1041-
}) => Some(assignment_issue_id),
1041+
}) => Some(*assignment_issue_id),
10421042
_ => None, // Was called with a nonexistent PR number, can't find an associated assignment
10431043
}
10441044
}

0 commit comments

Comments
 (0)