Add resize() method to IndexVec.

This commit is contained in:
Michael Woerister 2017-03-14 15:49:28 +01:00
parent 8c4f2c64c6
commit 9e0589a52b

View File

@ -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;