-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Filter combos that contain dependencies. #21
base: main
Are you sure you want to change the base?
Conversation
Sorry, but I probably won't have to review this until next week. My apologies! |
c9e4e68
to
ef81b9f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR! From a first pass I have a note about hashing FeatureKey
. Additionally, could you update tests/complex
or add a new test crate to test feature dependencies as well? You can use your original example as a starting point:
[dependencies]
foo = []
bar = ["foo"]
foobar = ["bar"]
Thank you so much, and sorry for the delay! :)
src/intern.rs
Outdated
@@ -18,7 +18,7 @@ use std::{ | |||
/// using the same [`FeatureKey`] to get the string from two separate [`FeatureStorage`]s will likely result | |||
/// in two different strings (if [`FeatureStorage::get()`] doesn't return [`None`], that is). | |||
#[repr(transparent)] | |||
#[derive(Clone, Copy, PartialEq, Eq, Debug)] | |||
#[derive(Clone, Copy, PartialEq, Eq, Debug, Hash)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should not implement Hash
, since it itself is a hash. (Hashing a hash is just extra work without extra benefit!)
Instead, FeatureKey
should derive Ord
and PartialOrd
and be used in a BTreeSet
instead of a HashSet
. BTreeSet
offers the same de-duplication capabilities as HashSet
, but is faster because it doesn't hash the key.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
Sure! what are the checks for the test features? just to run flag-frenzy over them manually, and check that there was no degradation? |
@BD103, another feature to consider, not for this PR:
The
or
to the configuration. |
Yup! There are no automated checks yet, so it's just manual.
Could you open an issue for this? |
@BD103 done - both manual checks, and the issue. |
If a combo contains two features that one is a direct or indirect dependency, the combo will now be filtered.
#19