apply review feedback

This commit is contained in:
Ralf Jung
2024-12-15 09:25:11 +01:00
parent 1f8236d4c7
commit 0c9d42cc56
2 changed files with 14 additions and 30 deletions

View File

@@ -2605,27 +2605,11 @@ impl TargetOptions {
}
pub(crate) fn has_feature(&self, search_feature: &str) -> bool {
self.features.split(',').any(|f| {
if let Some(f) = f.strip_prefix('+')
&& f == search_feature
{
true
} else {
false
}
})
self.features.split(',').any(|f| f.strip_prefix('+').is_some_and(|f| f == search_feature))
}
pub(crate) fn has_neg_feature(&self, search_feature: &str) -> bool {
self.features.split(',').any(|f| {
if let Some(f) = f.strip_prefix('-')
&& f == search_feature
{
true
} else {
false
}
})
self.features.split(',').any(|f| f.strip_prefix('-').is_some_and(|f| f == search_feature))
}
}