Ensures the vector is at least long enough to contain `index`, filling with `fill` as needed. Returns a mutable reference to the element at `index`. If the vector is too short, it is extended by calling `fill` repeatedly until it contains `index`. # Examples ``` # use hashql_core::id::{IdVec, Id as _, newtype}; # newtype!(struct MyId(u32 is 0..=100)); let mut vec = IdVec:: ::new(); le
(&mut self, index: I, fill: impl FnMut() -> T)
| 404 | /// assert_eq!(vec[MyId::new(5)], 42); |
| 405 | /// ``` |
| 406 | pub fn fill_until(&mut self, index: I, fill: impl FnMut() -> T) -> &mut T { |
| 407 | let new_length = index.as_usize() + 1; |
| 408 | |
| 409 | if self.len() < new_length { |
| 410 | self.raw.resize_with(new_length, fill); |
| 411 | } |
| 412 | |
| 413 | &mut self[index] |
| 414 | } |
| 415 | |
| 416 | /// Clears the vector, removing all elements. |
| 417 | /// |
no test coverage detected