From: Michael Woerister Date: Tue, 14 Mar 2017 14:49:28 +0000 (+0100) Subject: Add resize() method to IndexVec. X-Git-Url: https://git.lizzy.rs/?a=commitdiff_plain;h=9e0589a52b73e254460f90beb010f380b09ff0ba;p=rust.git Add resize() method to IndexVec. --- 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 @@ pub fn get_mut(&mut self, index: I) -> Option<&mut T> { } } +impl IndexVec { + #[inline] + pub fn resize(&mut self, new_len: usize, value: T) { + self.raw.resize(new_len, value) + } +} + impl Index for IndexVec { type Output = T;