Skip to content

Commit

Permalink
Add resize() method to IndexVec.
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelwoerister committed Mar 22, 2017
1 parent 8c4f2c6 commit 9e0589a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/librustc_data_structures/indexed_vec.rs
Expand Up @@ -189,6 +189,13 @@ impl<I: Idx, T> IndexVec<I, T> {
}
}

impl<I: Idx, T: Clone> IndexVec<I, T> {
#[inline]
pub fn resize(&mut self, new_len: usize, value: T) {
self.raw.resize(new_len, value)
}
}

impl<I: Idx, T> Index<I> for IndexVec<I, T> {
type Output = T;

Expand Down

0 comments on commit 9e0589a

Please sign in to comment.