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 <[email protected]> AuthorDate: Sat May 9 14:35:59 2026 +0800 fixup Signed-off-by: tison <[email protected]> --- 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: [email protected] For additional commands, e-mail: [email protected]
