Skip to content

Commit bfd54da

Browse files
committed
AI fix?
1 parent ee1a860 commit bfd54da

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/recipe.rs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,16 @@ impl System {
7373
fn enabled(self, enabled: HashMap<System, bool>, disabled: HashMap<System, bool>) -> bool {
7474
let not_disabled = !disabled[&self];
7575
let explicitly_enabled = enabled[&self];
76-
let no_others_enabled = !self.others().iter().any(|system| enabled[system]);
76+
let no_others_enabled = !self
77+
.others()
78+
.iter()
79+
.any(|system| *enabled.get(system).unwrap_or(&false));
80+
81+
// Special case for Unix family
82+
if self.is_specific_unix() && enabled.get(&System::Unix).copied().unwrap_or(false) {
83+
return !disabled.get(&self).copied().unwrap_or(false);
84+
}
85+
7786
not_disabled && (explicitly_enabled || no_others_enabled)
7887
}
7988
}
@@ -207,6 +216,7 @@ impl<'src, D> Recipe<'src, D> {
207216
(System::Linux, linux.unwrap_or(false)),
208217
(System::OpenBSD, openbsd.unwrap_or(false)),
209218
(System::Unix, unix.unwrap_or(false)),
219+
(System::Unrecognized, false),
210220
]
211221
.into_iter()
212222
.collect();
@@ -217,6 +227,7 @@ impl<'src, D> Recipe<'src, D> {
217227
(System::Linux, linux.is_some_and(bool::not)),
218228
(System::OpenBSD, openbsd.is_some_and(bool::not)),
219229
(System::Unix, unix.is_some_and(bool::not)),
230+
(System::Unrecognized, false),
220231
]
221232
.into_iter()
222233
.collect();

0 commit comments

Comments
 (0)