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' 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