Refactor how to get the span of a function header

This commit is contained in:
Folkert de Vries
2025-07-07 11:52:14 +02:00
parent 2912efa879
commit 5de9bc73e7
2 changed files with 32 additions and 37 deletions

View File

@@ -492,7 +492,7 @@ impl<'a> AstValidator<'a> {
}
if !spans.is_empty() {
let header_span = sig.header.span().unwrap_or(sig.span.shrink_to_lo());
let header_span = sig.header_span();
let suggestion_span = header_span.shrink_to_hi().to(sig.decl.output.span());
let padding = if header_span.is_empty() { "" } else { " " };