From db162d6eabc7830841ca0d1be7001617af8ef4c0 Mon Sep 17 00:00:00 2001 From: CJP10 Date: Sun, 18 Aug 2024 17:31:06 -0400 Subject: [PATCH] use experimental feature --- Cargo.toml | 3 +++ src/experimental.rs | 4 ++-- src/lib.rs | 1 + 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 73ff8cc..268d9eb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -22,3 +22,6 @@ criterion-plot = "0.5.0" [[bench]] name = "bench" harness = false + +[features] +experimental = [] diff --git a/src/experimental.rs b/src/experimental.rs index 2c491d4..97c6872 100644 --- a/src/experimental.rs +++ b/src/experimental.rs @@ -144,7 +144,7 @@ mod tests { #[test] fn empty() { - let p = Pool::<()>::from_iter(Vec::new()); + let p: Pool<()> = std::iter::empty().collect(); assert_eq!(p.len(), 0); assert_eq!(p.capacity(), 0); assert_eq!(p.bitset.ints.len(), 1); @@ -154,7 +154,7 @@ mod tests { #[test] fn pull_set_return() { - let p = Pool::from_iter(0..100usize); + let p: Pool = (0..100usize).collect(); assert_eq!(p.len(), 100); assert_eq!(p.capacity(), 100); assert_eq!(p.bitset.ints.len(), 2); diff --git a/src/lib.rs b/src/lib.rs index 0ba59f1..2a4b76d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -81,6 +81,7 @@ use std::mem::{forget, ManuallyDrop}; use std::ops::{Deref, DerefMut}; use std::sync::Arc; +#[cfg(feature = "experimental")] pub mod experimental; pub type Stack = Vec;