diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 42f8b5a..7be5704 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -38,7 +38,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-latest, windows-latest, macos-latest, macos-12] + os: [ubuntu-latest, windows-latest, macos-latest, macos-15-intel] features: ["", "--features=no_std"] profile: ["", "--release"] diff --git a/Cargo.toml b/Cargo.toml index fc4a67a..3d041e7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,7 +2,7 @@ name = "alloc-checked" description = "Collections that don't panic on alloc failures" authors = ["Adam Cimarosti "] -version = "0.1.2" +version = "0.1.3" edition = "2021" repository = "https://github.com/questdb/alloc-checked" keywords = ["alloc", "collections", "no-std", "safe-allocation", "container"] diff --git a/src/vec.rs b/src/vec.rs index 802b1e3..fef9b78 100644 --- a/src/vec.rs +++ b/src/vec.rs @@ -115,6 +115,16 @@ impl Vec { self.inner.as_mut_ptr() } + /// # Safety + /// + /// - `new_len` must be less than or equal to [`capacity()`]. + /// + /// [`capacity()`]: Self::capacity + #[inline] + pub unsafe fn set_len(&mut self, new_len: usize) { + self.inner.set_len(new_len); + } + #[inline] pub fn clear(&mut self) { self.inner.clear();