pub fn normalize_features_arg(input: &str) -> StringExpand description
Normalises a --features argument to the label format used by the matrix.
Accepts both the comma-separated cargo format ("otel,test") and the
human-readable label format ("otel + test"), sorts the parts
alphabetically, and joins them with " + ". An empty input returns
"default".
ยงExamples
use xtask_lib::tasks::util::matrix::normalize_features_arg;
assert_eq!(normalize_features_arg("otel,test"), "otel + test");
assert_eq!(normalize_features_arg("otel + test"), "otel + test");
assert_eq!(normalize_features_arg("test,otel"), "otel + test");
assert_eq!(normalize_features_arg(""), "default");
assert_eq!(normalize_features_arg(" "), "default");
assert_eq!(normalize_features_arg(",,"), "default");
assert_eq!(normalize_features_arg("+"), "default");
assert_eq!(normalize_features_arg("otel"), "otel");