From d13ccf3392283ec7c527a78093e1c6e9d627d186 Mon Sep 17 00:00:00 2001 From: Michael Goulet Date: Sun, 7 Apr 2024 19:38:05 -0400 Subject: [PATCH] Add a helper for extending a span to include any trailing whitespace --- clippy_lints/src/lifetimes.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/clippy_lints/src/lifetimes.rs b/clippy_lints/src/lifetimes.rs index a60a40a2a47..2bb63ec2b04 100644 --- a/clippy_lints/src/lifetimes.rs +++ b/clippy_lints/src/lifetimes.rs @@ -294,8 +294,7 @@ fn elision_suggestions( let span = cx .sess() .source_map() - .span_extend_while(usage.ident.span, |ch| ch.is_ascii_whitespace()) - .unwrap_or(usage.ident.span); + .span_extend_while_whitespace(usage.ident.span); (span, String::new()) },