Replace some unwraps with ?s where possible

This commit is contained in:
Yotam Ofek 2025-05-20 13:19:39 +00:00
parent 29d97cdabe
commit 7a68021dfc

View file

@ -538,7 +538,7 @@ fn document(
}
fmt::from_fn(move |f| {
document_item_info(cx, item, parent).render_into(f).unwrap();
document_item_info(cx, item, parent).render_into(f)?;
if parent.is_none() {
write!(f, "{}", document_full_collapsible(item, cx, heading_offset))
} else {
@ -582,7 +582,7 @@ fn document_short(
show_def_docs: bool,
) -> impl fmt::Display {
fmt::from_fn(move |f| {
document_item_info(cx, item, Some(parent)).render_into(f).unwrap();
document_item_info(cx, item, Some(parent)).render_into(f)?;
if !show_def_docs {
return Ok(());
}