From f9fa31d0d9fc2b43e052208a2e1bad0ef4183b64 Mon Sep 17 00:00:00 2001 From: Zachary Dremann Date: Mon, 16 Dec 2024 22:36:50 -0500 Subject: [PATCH 1/2] ci: with relaxed asserts, much less need for continue-on-error for minimal versions ci --- .github/workflows/rust.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index d21f865..c720c9a 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -61,11 +61,6 @@ jobs: cargo +${{ matrix.rust }} minimal-versions test --direct --workspace if: matrix.rust == 'nightly' && matrix.cargo_features == 'default' - # This only must pass when we're ready to release, allow it to fail unless this is a commit to master - # e.g if we're on a PR that's bumping the -sys crate, and requires changes to the main crate, the minimal version - # check _cannot_ succeed, because the new version of the -sys crate won't be published yet - continue-on-error: ${{ github.ref != 'refs/heads/master' }} - - name: Updated versions run: cargo update && cargo +${{ matrix.rust }} test --no-default-features --features "${{ matrix.cargo_features }}" if: matrix.rust == 'stable' && matrix.cargo_features == 'default' From 7069431409331671e18eaef9802efebe18b77a7e Mon Sep 17 00:00:00 2001 From: Zachary Dremann Date: Mon, 16 Dec 2024 22:39:45 -0500 Subject: [PATCH 2/2] feat: Bitset::is_empty --- croaring/src/bitset/imp.rs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/croaring/src/bitset/imp.rs b/croaring/src/bitset/imp.rs index f963a81..e96cfaf 100644 --- a/croaring/src/bitset/imp.rs +++ b/croaring/src/bitset/imp.rs @@ -263,6 +263,23 @@ impl Bitset { (word & mask) != 0 } + /// Check if the bitset is empty + /// + /// # Examples + /// ``` + /// use croaring::Bitset; + /// let mut bitset = Bitset::new(); + /// assert!(bitset.is_empty()); + /// bitset.set(100); + /// assert!(!bitset.is_empty()); + /// ``` + #[inline] + #[doc(alias = "bitset_empty")] + #[must_use] + pub fn is_empty(&self) -> bool { + unsafe { ffi::bitset_empty(&self.bitset) } + } + /// Count of number of set bits /// /// # Examples