You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@datasketches.apache.org by ti...@apache.org on 2026/05/09 06:40:16 UTC
(datasketches-rust) branch feature-flag created (now 71e929d)
This is an automated email from the ASF dual-hosted git repository.
tisonkun pushed a change to branch feature-flag
in repository https://gitbox.apache.org/repos/asf/datasketches-rust.git
at 71e929d fixup
This branch includes the following new commits:
new 46df975 refactor: gate sketches with feature flags
new 21bf744 human run
new 472a70b better test
new e7f43ee fixup
new 71e929d fixup
The 5 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datasketches.apache.org
For additional commands, e-mail: commits-help@datasketches.apache.org
(datasketches-rust) 04/05: fixup
Posted by ti...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
tisonkun pushed a commit to branch feature-flag
in repository https://gitbox.apache.org/repos/asf/datasketches-rust.git
commit e7f43eea0ec71d2a233e1b71c017bde98d3b005d
Author: tison <wa...@gmail.com>
AuthorDate: Sat May 9 14:35:59 2026 +0800
fixup
Signed-off-by: tison <wa...@gmail.com>
---
xtask/src/main.rs | 27 +++++++++++++++------------
1 file changed, 15 insertions(+), 12 deletions(-)
diff --git a/xtask/src/main.rs b/xtask/src/main.rs
index 44b6e25..57a02b0 100644
--- a/xtask/src/main.rs
+++ b/xtask/src/main.rs
@@ -15,6 +15,7 @@
// specific language governing permissions and limitations
// under the License.
+use std::path::Path;
use std::process::Command as StdCommand;
use clap::Parser;
@@ -51,27 +52,29 @@ struct CommandTest {
impl CommandTest {
fn run(self) {
- let features = get_sketch_features();
+ let features = sketches_features();
let features_refs: Vec<&str> = features.iter().map(|s| s.as_str()).collect();
run_command(make_test_cmd(self.no_capture, &features_refs));
}
}
-fn get_sketch_features() -> Vec<String> {
- let metadata = cargo_metadata::MetadataCommand::new()
- .manifest_path(std::path::Path::new(env!("CARGO_WORKSPACE_DIR")).join("Cargo.toml"))
+fn sketches_features() -> Vec<String> {
+ use cargo_metadata::Metadata;
+ use cargo_metadata::MetadataCommand;
+
+ let datasketches_manifest = Path::new(env!("CARGO_WORKSPACE_DIR")).join("Cargo.toml");
+
+ let Metadata { packages, .. } = MetadataCommand::new()
+ .manifest_path(datasketches_manifest)
.exec()
.expect("failed to get cargo metadata");
- let pkg = metadata
- .workspace_packages()
+
+ let pkg = packages
.into_iter()
- .find(|pkg| pkg.name == "datasketches")
+ .find(|p| p.name == "datasketches")
.expect("failed to find datasketches package");
- pkg.features
- .keys()
- .filter(|&f| f != "default")
- .cloned()
- .collect()
+
+ pkg.features.into_keys().collect()
}
#[derive(Parser)]
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datasketches.apache.org
For additional commands, e-mail: commits-help@datasketches.apache.org
(datasketches-rust) 01/05: refactor: gate sketches with feature flags
Posted by ti...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
tisonkun pushed a commit to branch feature-flag
in repository https://gitbox.apache.org/repos/asf/datasketches-rust.git
commit 46df9753864eb3c001cb4bf54dada3c54533297f
Author: tison <wa...@gmail.com>
AuthorDate: Sat May 9 14:15:29 2026 +0800
refactor: gate sketches with feature flags
Signed-off-by: tison <wa...@gmail.com>
---
datasketches/Cargo.toml | 10 ++++++++++
datasketches/src/lib.rs | 14 ++++++++++++++
datasketches/tests/bloom_serialization_test.rs | 2 ++
datasketches/tests/countmin_test.rs | 2 ++
datasketches/tests/cpc_serialization_test.rs | 2 ++
datasketches/tests/cpc_union_test.rs | 2 ++
datasketches/tests/cpc_update_test.rs | 2 ++
datasketches/tests/cpc_wrapper_test.rs | 2 ++
datasketches/tests/frequencies_serialization_test.rs | 2 ++
datasketches/tests/frequencies_update_test.rs | 2 ++
datasketches/tests/hll_serialization_test.rs | 2 ++
datasketches/tests/hll_union_test.rs | 2 ++
datasketches/tests/hll_update_test.rs | 2 ++
datasketches/tests/tdigest_serialization_test.rs | 2 ++
datasketches/tests/tdigest_test.rs | 2 ++
datasketches/tests/theta_intersection_test.rs | 2 ++
datasketches/tests/theta_serialization_test.rs | 2 ++
datasketches/tests/theta_sketch_test.rs | 2 ++
18 files changed, 56 insertions(+)
diff --git a/datasketches/Cargo.toml b/datasketches/Cargo.toml
index 214288e..ba79372 100644
--- a/datasketches/Cargo.toml
+++ b/datasketches/Cargo.toml
@@ -34,6 +34,16 @@ keywords = ["sketch", "hyperloglog", "probabilistic"]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]
+[features]
+default = []
+bloom = []
+countmin = []
+cpc = []
+frequencies = []
+hll = []
+tdigest = []
+theta = []
+
[dev-dependencies]
googletest = { workspace = true }
insta = { workspace = true }
diff --git a/datasketches/src/lib.rs b/datasketches/src/lib.rs
index 33ea2f8..0bd9d1f 100644
--- a/datasketches/src/lib.rs
+++ b/datasketches/src/lib.rs
@@ -30,16 +30,30 @@
#[cfg(target_endian = "big")]
compile_error!("datasketches does not support big-endian targets");
+#[cfg(feature = "bloom")]
+#[cfg_attr(docsrs, doc(cfg(feature = "bloom")))]
pub mod bloom;
pub mod codec;
pub mod common;
+#[cfg(feature = "countmin")]
+#[cfg_attr(docsrs, doc(cfg(feature = "countmin")))]
pub mod countmin;
+#[cfg(feature = "cpc")]
+#[cfg_attr(docsrs, doc(cfg(feature = "cpc")))]
pub mod cpc;
pub mod error;
+#[cfg(feature = "frequencies")]
+#[cfg_attr(docsrs, doc(cfg(feature = "frequencies")))]
pub mod frequencies;
pub mod hash_value;
+#[cfg(feature = "hll")]
+#[cfg_attr(docsrs, doc(cfg(feature = "hll")))]
pub mod hll;
+#[cfg(feature = "tdigest")]
+#[cfg_attr(docsrs, doc(cfg(feature = "tdigest")))]
pub mod tdigest;
+#[cfg(feature = "theta")]
+#[cfg_attr(docsrs, doc(cfg(feature = "theta")))]
pub mod theta;
mod hash;
diff --git a/datasketches/tests/bloom_serialization_test.rs b/datasketches/tests/bloom_serialization_test.rs
index 15daba2..f096679 100644
--- a/datasketches/tests/bloom_serialization_test.rs
+++ b/datasketches/tests/bloom_serialization_test.rs
@@ -15,6 +15,8 @@
// specific language governing permissions and limitations
// under the License.
+#![cfg(feature = "bloom")]
+
mod common;
use std::fs;
diff --git a/datasketches/tests/countmin_test.rs b/datasketches/tests/countmin_test.rs
index dddc72c..a8681e4 100644
--- a/datasketches/tests/countmin_test.rs
+++ b/datasketches/tests/countmin_test.rs
@@ -15,6 +15,8 @@
// specific language governing permissions and limitations
// under the License.
+#![cfg(feature = "countmin")]
+
use datasketches::countmin::CountMinSketch;
#[test]
diff --git a/datasketches/tests/cpc_serialization_test.rs b/datasketches/tests/cpc_serialization_test.rs
index bbcb56e..85b749a 100644
--- a/datasketches/tests/cpc_serialization_test.rs
+++ b/datasketches/tests/cpc_serialization_test.rs
@@ -15,6 +15,8 @@
// specific language governing permissions and limitations
// under the License.
+#![cfg(feature = "cpc")]
+
mod common;
use std::fs;
diff --git a/datasketches/tests/cpc_union_test.rs b/datasketches/tests/cpc_union_test.rs
index 36badbd..5bc3b18 100644
--- a/datasketches/tests/cpc_union_test.rs
+++ b/datasketches/tests/cpc_union_test.rs
@@ -15,6 +15,8 @@
// specific language governing permissions and limitations
// under the License.
+#![cfg(feature = "cpc")]
+
use datasketches::cpc::CpcSketch;
use datasketches::cpc::CpcUnion;
use googletest::assert_that;
diff --git a/datasketches/tests/cpc_update_test.rs b/datasketches/tests/cpc_update_test.rs
index 7b814f7..8e78995 100644
--- a/datasketches/tests/cpc_update_test.rs
+++ b/datasketches/tests/cpc_update_test.rs
@@ -15,6 +15,8 @@
// specific language governing permissions and limitations
// under the License.
+#![cfg(feature = "cpc")]
+
use datasketches::common::NumStdDev;
use datasketches::cpc::CpcSketch;
use googletest::assert_that;
diff --git a/datasketches/tests/cpc_wrapper_test.rs b/datasketches/tests/cpc_wrapper_test.rs
index 6355ed0..4545e20 100644
--- a/datasketches/tests/cpc_wrapper_test.rs
+++ b/datasketches/tests/cpc_wrapper_test.rs
@@ -15,6 +15,8 @@
// specific language governing permissions and limitations
// under the License.
+#![cfg(feature = "cpc")]
+
use datasketches::common::NumStdDev;
use datasketches::cpc::CpcSketch;
use datasketches::cpc::CpcUnion;
diff --git a/datasketches/tests/frequencies_serialization_test.rs b/datasketches/tests/frequencies_serialization_test.rs
index f8d95bc..fd82761 100644
--- a/datasketches/tests/frequencies_serialization_test.rs
+++ b/datasketches/tests/frequencies_serialization_test.rs
@@ -15,6 +15,8 @@
// specific language governing permissions and limitations
// under the License.
+#![cfg(feature = "frequencies")]
+
mod common;
use std::fs;
diff --git a/datasketches/tests/frequencies_update_test.rs b/datasketches/tests/frequencies_update_test.rs
index a5a98e1..f15f219 100644
--- a/datasketches/tests/frequencies_update_test.rs
+++ b/datasketches/tests/frequencies_update_test.rs
@@ -15,6 +15,8 @@
// specific language governing permissions and limitations
// under the License.
+#![cfg(feature = "frequencies")]
+
use datasketches::frequencies::ErrorType;
use datasketches::frequencies::FrequentItemsSketch;
diff --git a/datasketches/tests/hll_serialization_test.rs b/datasketches/tests/hll_serialization_test.rs
index 4f7291b..c3f9d97 100644
--- a/datasketches/tests/hll_serialization_test.rs
+++ b/datasketches/tests/hll_serialization_test.rs
@@ -15,6 +15,8 @@
// specific language governing permissions and limitations
// under the License.
+#![cfg(feature = "hll")]
+
mod common;
use std::fs;
diff --git a/datasketches/tests/hll_union_test.rs b/datasketches/tests/hll_union_test.rs
index 91080bf..5bc3bb8 100644
--- a/datasketches/tests/hll_union_test.rs
+++ b/datasketches/tests/hll_union_test.rs
@@ -15,6 +15,8 @@
// specific language governing permissions and limitations
// under the License.
+#![cfg(feature = "hll")]
+
//! HyperLogLog Union Integration Tests
//!
//! These tests verify the public API behavior of HllUnion, focusing on:
diff --git a/datasketches/tests/hll_update_test.rs b/datasketches/tests/hll_update_test.rs
index e72c6fc..0b0d611 100644
--- a/datasketches/tests/hll_update_test.rs
+++ b/datasketches/tests/hll_update_test.rs
@@ -15,6 +15,8 @@
// specific language governing permissions and limitations
// under the License.
+#![cfg(feature = "hll")]
+
use datasketches::common::NumStdDev;
use datasketches::hll::HllSketch;
use datasketches::hll::HllType;
diff --git a/datasketches/tests/tdigest_serialization_test.rs b/datasketches/tests/tdigest_serialization_test.rs
index 18f58ce..d52983e 100644
--- a/datasketches/tests/tdigest_serialization_test.rs
+++ b/datasketches/tests/tdigest_serialization_test.rs
@@ -15,6 +15,8 @@
// specific language governing permissions and limitations
// under the License.
+#![cfg(feature = "tdigest")]
+
mod common;
use std::fs;
diff --git a/datasketches/tests/tdigest_test.rs b/datasketches/tests/tdigest_test.rs
index b61d779..cce2130 100644
--- a/datasketches/tests/tdigest_test.rs
+++ b/datasketches/tests/tdigest_test.rs
@@ -15,6 +15,8 @@
// specific language governing permissions and limitations
// under the License.
+#![cfg(feature = "tdigest")]
+
use datasketches::tdigest::TDigestMut;
use googletest::assert_that;
use googletest::prelude::eq;
diff --git a/datasketches/tests/theta_intersection_test.rs b/datasketches/tests/theta_intersection_test.rs
index 4959529..9b98062 100644
--- a/datasketches/tests/theta_intersection_test.rs
+++ b/datasketches/tests/theta_intersection_test.rs
@@ -15,6 +15,8 @@
// specific language governing permissions and limitations
// under the License.
+#![cfg(feature = "theta")]
+
use datasketches::theta::CompactThetaSketch;
use datasketches::theta::ThetaIntersection;
use datasketches::theta::ThetaSketch;
diff --git a/datasketches/tests/theta_serialization_test.rs b/datasketches/tests/theta_serialization_test.rs
index fd07d51..48c1c12 100644
--- a/datasketches/tests/theta_serialization_test.rs
+++ b/datasketches/tests/theta_serialization_test.rs
@@ -15,6 +15,8 @@
// specific language governing permissions and limitations
// under the License.
+#![cfg(feature = "theta")]
+
mod common;
use std::fs;
diff --git a/datasketches/tests/theta_sketch_test.rs b/datasketches/tests/theta_sketch_test.rs
index 28448c2..55664ef 100644
--- a/datasketches/tests/theta_sketch_test.rs
+++ b/datasketches/tests/theta_sketch_test.rs
@@ -15,6 +15,8 @@
// specific language governing permissions and limitations
// under the License.
+#![cfg(feature = "theta")]
+
use datasketches::common::NumStdDev;
use datasketches::hash_value;
use datasketches::theta::ThetaSketch;
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datasketches.apache.org
For additional commands, e-mail: commits-help@datasketches.apache.org
(datasketches-rust) 03/05: better test
Posted by ti...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
tisonkun pushed a commit to branch feature-flag
in repository https://gitbox.apache.org/repos/asf/datasketches-rust.git
commit 472a70b99e5c5d5708f9fe492a7451cb9f54993c
Author: tison <wa...@gmail.com>
AuthorDate: Sat May 9 14:29:03 2026 +0800
better test
Signed-off-by: tison <wa...@gmail.com>
---
Cargo.lock | 58 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
Cargo.toml | 1 +
xtask/Cargo.toml | 1 +
xtask/src/main.rs | 21 +++++++++++++++++++-
4 files changed, 80 insertions(+), 1 deletion(-)
diff --git a/Cargo.lock b/Cargo.lock
index 3f3c50a..759784f 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -79,6 +79,38 @@ version = "2.11.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c4512299f36f043ab09a583e57bceb5a5aab7a73db1805848e8fef3c9e8c78b3"
+[[package]]
+name = "camino"
+version = "1.2.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e629a66d692cb9ff1a1c664e41771b3dcaf961985a9774c0eb0bd1b51cf60a48"
+dependencies = [
+ "serde_core",
+]
+
+[[package]]
+name = "cargo-platform"
+version = "0.3.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8abf5d501fd757c2d2ee78d0cc40f606e92e3a63544420316565556ed28485e2"
+dependencies = [
+ "serde",
+]
+
+[[package]]
+name = "cargo_metadata"
+version = "0.23.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ef987d17b0a113becdd19d3d0022d04d7ef41f9efe4f3fb63ac44ba61df3ade9"
+dependencies = [
+ "camino",
+ "cargo-platform",
+ "semver",
+ "serde",
+ "serde_json",
+ "thiserror",
+]
+
[[package]]
name = "cfg-if"
version = "1.0.4"
@@ -421,6 +453,10 @@ name = "semver"
version = "1.0.28"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8a7852d02fc848982e0c167ef163aaff9cd91dc640ba85e263cb1ce46fae51cd"
+dependencies = [
+ "serde",
+ "serde_core",
+]
[[package]]
name = "serde"
@@ -429,6 +465,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e"
dependencies = [
"serde_core",
+ "serde_derive",
]
[[package]]
@@ -500,6 +537,26 @@ dependencies = [
"windows-sys",
]
+[[package]]
+name = "thiserror"
+version = "2.0.18"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4288b5bcbc7920c07a1149a35cf9590a2aa808e0bc1eafaade0b80947865fbc4"
+dependencies = [
+ "thiserror-impl",
+]
+
+[[package]]
+name = "thiserror-impl"
+version = "2.0.18"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ebc4ee7f67670e9b64d05fa4253e753e016c6c95ff35b89b7941d6b856dec1d5"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn",
+]
+
[[package]]
name = "unicode-ident"
version = "1.0.24"
@@ -692,6 +749,7 @@ dependencies = [
name = "x"
version = "0.0.0"
dependencies = [
+ "cargo_metadata",
"clap",
"which",
]
diff --git a/Cargo.toml b/Cargo.toml
index a51f388..a6e40dc 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -35,6 +35,7 @@ datasketches = { path = "datasketches" }
clap = { version = "4.5.20", features = ["derive"] }
insta = { version = "1.46.1" }
googletest = { version = "0.14.2" }
+cargo_metadata = { version = "0.23.1" }
which = { version = "8.0.0" }
[workspace.lints.rust]
diff --git a/xtask/Cargo.toml b/xtask/Cargo.toml
index 5b04167..080aa8a 100644
--- a/xtask/Cargo.toml
+++ b/xtask/Cargo.toml
@@ -31,6 +31,7 @@ release = false
[dependencies]
clap = { workspace = true }
+cargo_metadata = { workspace = true }
which = { workspace = true }
[lints]
diff --git a/xtask/src/main.rs b/xtask/src/main.rs
index 6af7f65..44b6e25 100644
--- a/xtask/src/main.rs
+++ b/xtask/src/main.rs
@@ -51,10 +51,29 @@ struct CommandTest {
impl CommandTest {
fn run(self) {
- run_command(make_test_cmd(self.no_capture, &[]));
+ let features = get_sketch_features();
+ let features_refs: Vec<&str> = features.iter().map(|s| s.as_str()).collect();
+ run_command(make_test_cmd(self.no_capture, &features_refs));
}
}
+fn get_sketch_features() -> Vec<String> {
+ let metadata = cargo_metadata::MetadataCommand::new()
+ .manifest_path(std::path::Path::new(env!("CARGO_WORKSPACE_DIR")).join("Cargo.toml"))
+ .exec()
+ .expect("failed to get cargo metadata");
+ let pkg = metadata
+ .workspace_packages()
+ .into_iter()
+ .find(|pkg| pkg.name == "datasketches")
+ .expect("failed to find datasketches package");
+ pkg.features
+ .keys()
+ .filter(|&f| f != "default")
+ .cloned()
+ .collect()
+}
+
#[derive(Parser)]
#[clap(name = "lint")]
struct CommandLint {
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datasketches.apache.org
For additional commands, e-mail: commits-help@datasketches.apache.org
(datasketches-rust) 05/05: fixup
Posted by ti...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
tisonkun pushed a commit to branch feature-flag
in repository https://gitbox.apache.org/repos/asf/datasketches-rust.git
commit 71e929d4e531ef5e6c1b63d22b71195d3e79ac08
Author: tison <wa...@gmail.com>
AuthorDate: Sat May 9 14:40:02 2026 +0800
fixup
Signed-off-by: tison <wa...@gmail.com>
---
Cargo.lock | 8 ++++----
Cargo.toml | 2 +-
xtask/src/main.rs | 5 ++---
3 files changed, 7 insertions(+), 8 deletions(-)
diff --git a/Cargo.lock b/Cargo.lock
index 759784f..a9c0fff 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -90,18 +90,18 @@ dependencies = [
[[package]]
name = "cargo-platform"
-version = "0.3.0"
+version = "0.1.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8abf5d501fd757c2d2ee78d0cc40f606e92e3a63544420316565556ed28485e2"
+checksum = "e35af189006b9c0f00a064685c727031e3ed2d8020f7ba284d78cc2671bd36ea"
dependencies = [
"serde",
]
[[package]]
name = "cargo_metadata"
-version = "0.23.1"
+version = "0.19.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ef987d17b0a113becdd19d3d0022d04d7ef41f9efe4f3fb63ac44ba61df3ade9"
+checksum = "dd5eb614ed4c27c5d706420e4320fbe3216ab31fa1c33cd8246ac36dae4479ba"
dependencies = [
"camino",
"cargo-platform",
diff --git a/Cargo.toml b/Cargo.toml
index a6e40dc..d6c113d 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -35,7 +35,7 @@ datasketches = { path = "datasketches" }
clap = { version = "4.5.20", features = ["derive"] }
insta = { version = "1.46.1" }
googletest = { version = "0.14.2" }
-cargo_metadata = { version = "0.23.1" }
+cargo_metadata = { version = "0.19.1" }
which = { version = "8.0.0" }
[workspace.lints.rust]
diff --git a/xtask/src/main.rs b/xtask/src/main.rs
index 57a02b0..5bcaaac 100644
--- a/xtask/src/main.rs
+++ b/xtask/src/main.rs
@@ -53,8 +53,7 @@ struct CommandTest {
impl CommandTest {
fn run(self) {
let features = sketches_features();
- let features_refs: Vec<&str> = features.iter().map(|s| s.as_str()).collect();
- run_command(make_test_cmd(self.no_capture, &features_refs));
+ run_command(make_test_cmd(self.no_capture, &features));
}
}
@@ -122,7 +121,7 @@ fn run_command(mut cmd: StdCommand) {
assert!(status.success(), "command failed: {status}");
}
-fn make_test_cmd(no_capture: bool, features: &[&str]) -> StdCommand {
+fn make_test_cmd(no_capture: bool, features: &[String]) -> StdCommand {
let mut cmd = find_command("cargo");
cmd.args(["test", "--workspace", "--no-default-features"]);
if !features.is_empty() {
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datasketches.apache.org
For additional commands, e-mail: commits-help@datasketches.apache.org
(datasketches-rust) 02/05: human run
Posted by ti...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
tisonkun pushed a commit to branch feature-flag
in repository https://gitbox.apache.org/repos/asf/datasketches-rust.git
commit 21bf744fbf4604777422c71f3ba49fe6d538477d
Author: tison <wa...@gmail.com>
AuthorDate: Sat May 9 14:21:28 2026 +0800
human run
Signed-off-by: tison <wa...@gmail.com>
---
Cargo.toml | 1 -
datasketches/Cargo.toml | 2 ++
datasketches/src/lib.rs | 22 +++++++++++-----------
3 files changed, 13 insertions(+), 12 deletions(-)
diff --git a/Cargo.toml b/Cargo.toml
index 38d8511..a51f388 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -35,7 +35,6 @@ datasketches = { path = "datasketches" }
clap = { version = "4.5.20", features = ["derive"] }
insta = { version = "1.46.1" }
googletest = { version = "0.14.2" }
-rand = { version = "0.9.2" }
which = { version = "8.0.0" }
[workspace.lints.rust]
diff --git a/datasketches/Cargo.toml b/datasketches/Cargo.toml
index ba79372..696fe39 100644
--- a/datasketches/Cargo.toml
+++ b/datasketches/Cargo.toml
@@ -36,6 +36,8 @@ rustdoc-args = ["--cfg", "docsrs"]
[features]
default = []
+
+# Each sketch has its own feature, so that users can opt in to only the sketches they need.
bloom = []
countmin = []
cpc = []
diff --git a/datasketches/src/lib.rs b/datasketches/src/lib.rs
index 0bd9d1f..833d463 100644
--- a/datasketches/src/lib.rs
+++ b/datasketches/src/lib.rs
@@ -30,30 +30,30 @@
#[cfg(target_endian = "big")]
compile_error!("datasketches does not support big-endian targets");
+// sketches modules
+
#[cfg(feature = "bloom")]
-#[cfg_attr(docsrs, doc(cfg(feature = "bloom")))]
pub mod bloom;
-pub mod codec;
-pub mod common;
#[cfg(feature = "countmin")]
-#[cfg_attr(docsrs, doc(cfg(feature = "countmin")))]
pub mod countmin;
#[cfg(feature = "cpc")]
-#[cfg_attr(docsrs, doc(cfg(feature = "cpc")))]
pub mod cpc;
-pub mod error;
#[cfg(feature = "frequencies")]
-#[cfg_attr(docsrs, doc(cfg(feature = "frequencies")))]
pub mod frequencies;
-pub mod hash_value;
#[cfg(feature = "hll")]
-#[cfg_attr(docsrs, doc(cfg(feature = "hll")))]
pub mod hll;
#[cfg(feature = "tdigest")]
-#[cfg_attr(docsrs, doc(cfg(feature = "tdigest")))]
pub mod tdigest;
#[cfg(feature = "theta")]
-#[cfg_attr(docsrs, doc(cfg(feature = "theta")))]
pub mod theta;
+// common used modules
+
+pub mod codec;
+pub mod common;
+pub mod error;
+pub mod hash_value;
+
+// private internal modules
+
mod hash;
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datasketches.apache.org
For additional commands, e-mail: commits-help@datasketches.apache.org