Use CARGO_CFG_FEATURE - #88
Conversation
90a829c to
622fdb4
Compare
| let mut features: Vec<String> = self | ||
| .get_override_var("FEATURES") | ||
| .unwrap_or_else(|| { | ||
| self.get_var::<Vec<String>>("CARGO_CFG_FEATURE") |
There was a problem hiding this comment.
Why is get_var required here, instead of just self.get() (like here)?
There was a problem hiding this comment.
It looked a bit messy using .get() and then parse_from_env here in order to get a Vec<String>.
happy to switch to that if you prefer it.
also happy for you to take over to adjust this PR to how you prefer it.
There was a problem hiding this comment.
afaics it'd more appropriate to simply get CARGO_CFG_FEATURE from the env directly (if it is defined at all) in case there is no override, and use that exclusively instead of CARGO_FEATURE_.... The .get_var() in the current PR goes through the whole machinery of tracking unused overrides, which .get_override_var("FEATURES") already does for this case. It's not a problem to not use parse_from_env() to "parse" CARGO_CFG_FEATURE, since we only ever need to split the string on ,
622fdb4 to
56b5689
Compare
| @@ -0,0 +1,2 @@ | |||
| [tools] | |||
| osv-scanner = "latest" | |||
56b5689 to
d9469cc
Compare
|
Thanks |
Close #83