Set the vector’s length without dropping or moving out elements This method is `unsafe` because it changes the notion of the number of “valid” elements in the vector. Use with care. This method uses *debug assertions* to check that `length` is not greater than the capacity. # Safety Must ensure that length <= self.capacity()
(&mut self, length: usize)
| 222 | /// # Safety |
| 223 | /// Must ensure that length <= self.capacity() |
| 224 | pub unsafe fn set_len(&mut self, length: usize) { |
| 225 | debug_assert!(length <= self.capacity()); |
| 226 | self.len = length; |
| 227 | } |
| 228 | |
| 229 | /// Copy and appends all elements in a slice to the `BoxVec`. |
| 230 | /// |
no outgoing calls
no test coverage detected