Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 1 addition & 29 deletions src/features.rs
Original file line number Diff line number Diff line change
Expand Up @@ -160,16 +160,7 @@ impl Feature {
) -> bool {
if let Some(v) = map.get(cur) {
for cur in v {
let fname = if let Some(slash_idx) = cur.find('/') {
// The fname may still have a '?' suffix, which is fine.
// Because in that case it doesn't activate that dependency, so it can be ignored.
let (fname, _) = cur.split_at(slash_idx);
fname
} else {
// Could be 'dep:something', which is fine because it's not a feature.
cur
};
if fname != root && (group.matches(fname) || rec(group, map, fname, root)) {
if cur != root && (group.matches(cur) || rec(group, map, cur, root)) {
return true;
}
}
Expand Down Expand Up @@ -405,25 +396,6 @@ mod tests {
vec!["b", "async-std"]
]);

let map = map![
("tokio", v![]),
("async-std", v![]),
("a", v!["tokio/full"]),
("b", v!["async-std?/alloc"])
];
let list = v!["a", "b", "tokio", "async-std"];
let mutually_exclusive_features = [Feature::group(["tokio", "async-std"])];
let filtered = feature_powerset(&list, None, &[], &mutually_exclusive_features, &map);
assert_eq!(filtered, vec![
vec!["a"],
vec!["b"],
vec!["a", "b"],
vec!["tokio"],
vec!["b", "tokio"],
vec!["async-std"],
vec!["b", "async-std"]
]);

let map = map![("a", v![]), ("b", v!["a"]), ("c", v![]), ("d", v!["b"])];
let list = v!["a", "b", "c", "d"];
let mutually_exclusive_features = [Feature::group(["a", "c"])];
Expand Down