fix: resolve clippy warnings from #14 (collapsible_if, manual_inspect)

CI runs Rust 1.94 which flags these. Collapsed nested if-let in
cell_has_block_content() and replaced .map()+return with .inspect()
in table_to_md().

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Valerio 2026-04-04 15:28:59 +02:00
parent 3cf9dbaf2a
commit 5ea646a332

View file

@ -526,10 +526,10 @@ fn cell_has_block_content(cell: ElementRef<'_>) -> bool {
"aside",
];
for desc in cell.descendants() {
if let Some(el) = ElementRef::wrap(desc) {
if BLOCK_TAGS.contains(&el.value().name()) {
return true;
}
if let Some(el) = ElementRef::wrap(desc)
&& BLOCK_TAGS.contains(&el.value().name())
{
return true;
}
}
false
@ -560,14 +560,13 @@ fn table_to_md(
!exclude.contains(&c.id())
&& (c.value().name() == "th" || c.value().name() == "td")
})
.map(|c| {
.inspect(|&c| {
if c.value().name() == "th" {
has_header = true;
}
if !is_layout && cell_has_block_content(c) {
is_layout = true;
}
c
})
.collect();