1
Fork 0

Add and use IndexVec::append

This commit is contained in:
Josh Stone 2024-08-13 12:29:46 -07:00
parent 80eb5a8e91
commit 0a34ce49ce
2 changed files with 7 additions and 2 deletions

View file

@ -188,6 +188,11 @@ impl<I: Idx, T> IndexVec<I, T> {
let min_new_len = elem.index() + 1;
self.raw.resize_with(min_new_len, fill_value);
}
#[inline]
pub fn append(&mut self, other: &mut Self) {
self.raw.append(&mut other.raw);
}
}
/// `IndexVec` is often used as a map, so it provides some map-like APIs.