Skip to content

Commit 9e0589a

Browse files
Add resize() method to IndexVec.
1 parent 8c4f2c6 commit 9e0589a

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/librustc_data_structures/indexed_vec.rs

+7
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,13 @@ impl<I: Idx, T> IndexVec<I, T> {
189189
}
190190
}
191191

192+
impl<I: Idx, T: Clone> IndexVec<I, T> {
193+
#[inline]
194+
pub fn resize(&mut self, new_len: usize, value: T) {
195+
self.raw.resize(new_len, value)
196+
}
197+
}
198+
192199
impl<I: Idx, T> Index<I> for IndexVec<I, T> {
193200
type Output = T;
194201

0 commit comments

Comments
 (0)