diff options
| author | Michael Woerister <michaelwoerister@posteo.net> | 2017-03-14 15:49:28 +0100 |
|---|---|---|
| committer | Michael Woerister <michaelwoerister@posteo.net> | 2017-03-22 16:11:18 +0100 |
| commit | 9e0589a52b73e254460f90beb010f380b09ff0ba (patch) | |
| tree | 27c6f660f5073ed86d773657129525bc1fe125ed /src/librustc_data_structures | |
| parent | 8c4f2c64c6759a82f143e23964a46a65c67509c9 (diff) | |
| download | rust-9e0589a52b73e254460f90beb010f380b09ff0ba.tar.gz rust-9e0589a52b73e254460f90beb010f380b09ff0ba.zip | |
Add resize() method to IndexVec.
Diffstat (limited to 'src/librustc_data_structures')
| -rw-r--r-- | src/librustc_data_structures/indexed_vec.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/librustc_data_structures/indexed_vec.rs b/src/librustc_data_structures/indexed_vec.rs index 3f478d7c165..62c430dda32 100644 --- a/src/librustc_data_structures/indexed_vec.rs +++ b/src/librustc_data_structures/indexed_vec.rs @@ -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; |
