Add resize() method to IndexVec.
This commit is contained in:
parent
8c4f2c64c6
commit
9e0589a52b
1 changed files with 7 additions and 0 deletions
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue