From 6d4eb3b15595a9d84261e56b20bbf2495ebcef72 Mon Sep 17 00:00:00 2001 From: Jakob Hellermann Date: Wed, 17 Mar 2021 18:18:20 +0100 Subject: [PATCH] add const FixedBitSet::new constructor --- src/lib.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index 47b626e..8098cb5 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -59,6 +59,15 @@ pub struct FixedBitSet { impl FixedBitSet { + /// Create a new empty **FixedBitSet**. + pub const fn new() -> Self + { + FixedBitSet { + data: Vec::new(), + length: 0, + } + } + /// Create a new **FixedBitSet** with a specific number of bits, /// all initially clear. pub fn with_capacity(bits: usize) -> Self