Skip to content

Commit b984283

Browse files
committed
Handle no-chip case explicitly
1 parent b56a167 commit b984283

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

xtask/src/documentation.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,11 @@ fn pre_process_cargo_toml(chip: Option<Chip>, package_path: &PathBuf) -> Result<
318318
let mut processed_cargo_toml = Vec::new();
319319
let mut engine = somni_expr::Context::new();
320320
engine.add_function("chip", move |cond: &str| -> bool {
321-
cond == chip.as_ref().map(|c| c.to_string()).unwrap_or_default()
321+
if let Some(chip) = chip {
322+
cond == chip.to_string()
323+
} else {
324+
false
325+
}
322326
});
323327

324328
let mut hide = false;

0 commit comments

Comments
 (0)