Skip to content

Commit

Permalink
Change from &mut Vec<Vec<_>> to &mut [Vec<_>], since the outer
Browse files Browse the repository at this point in the history
`Vec` should not be resized.
  • Loading branch information
nikomatsakis committed Nov 11, 2015
1 parent f027612 commit 3b903a7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/librustc_mir/build/matches/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ impl<'a,'tcx> Builder<'a,'tcx> {
test_lvalue: &Lvalue<'tcx>,
test: &Test<'tcx>,
candidate: &Candidate<'pat, 'tcx>,
resulting_candidates: &mut Vec<Vec<Candidate<'pat, 'tcx>>>) {
resulting_candidates: &mut [Vec<Candidate<'pat, 'tcx>>]) {
// Find the match_pair for this lvalue (if any). At present,
// afaik, there can be at most one. (In the future, if we
// adopted a more general `@` operator, there might be more
Expand Down Expand Up @@ -394,7 +394,7 @@ impl<'a,'tcx> Builder<'a,'tcx> {

fn add_to_all_candidate_sets<'pat>(&mut self,
candidate: &Candidate<'pat, 'tcx>,
resulting_candidates: &mut Vec<Vec<Candidate<'pat, 'tcx>>>) {
resulting_candidates: &mut [Vec<Candidate<'pat, 'tcx>>]) {
for resulting_candidate in resulting_candidates {
resulting_candidate.push(candidate.clone());
}
Expand Down

0 comments on commit 3b903a7

Please sign in to comment.