diff --git a/crates/core/src/alloc/vec.rs b/crates/core/src/alloc/vec.rs index 681371f03cc8..c1cd3d3360a3 100644 --- a/crates/core/src/alloc/vec.rs +++ b/crates/core/src/alloc/vec.rs @@ -288,6 +288,11 @@ impl Vec { // use `std`'s `into_boxed_slice` without fear of `realloc`. Ok(self.inner.into_boxed_slice()) } + + /// Same as [`std::vec::Vec::clear`]. + pub fn clear(&mut self) { + self.inner.clear(); + } } impl Deref for Vec {