Skip to content

Commit

Permalink
Merge 974e63e into 2ca2d3c
Browse files Browse the repository at this point in the history
  • Loading branch information
Alorel committed Oct 28, 2023
2 parents 2ca2d3c + 974e63e commit 839af79
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/parse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ where
{
it.into_iter()
.map(Spanned::span)
.reduce(move |a, b| a.join(b).unwrap())
.reduce(move |a, b| if let Some(span) = a.join(b) { span } else { a })
.unwrap_or_else(Span::call_site)
}

Expand Down Expand Up @@ -84,7 +84,13 @@ fn fmt_named(fields: impl IntoIterator<Item = syn::Field>) -> impl Iterator<Item
fields.into_iter().map(
move |syn::Field {
attrs, ident, ty, ..
}| { (attrs, Ok(ident.unwrap()), ty) },
}| {
(
attrs,
Ok(ident.expect("Failed to get ident off a named field")),
ty,
)
},
)
}

Expand Down

0 comments on commit 839af79

Please sign in to comment.