From 7b800b7d02676849f514eba17ac9cd2c52e22772 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 4800bfa..2311792 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -65,6 +65,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