From 121d3ab89e359d0fd9a77e0a99f90237609f8ddb Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Mon, 7 Oct 2024 13:25:38 +1100 Subject: [PATCH] Avoid another `&Lrc<..>` in a return value. --- clippy_utils/src/source.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/clippy_utils/src/source.rs b/clippy_utils/src/source.rs index 4ad7575e7..eecbfb393 100644 --- a/clippy_utils/src/source.rs +++ b/clippy_utils/src/source.rs @@ -287,6 +287,7 @@ impl SourceFileRange { self.sf .src .as_ref() + .map(|src| src.as_str()) .or_else(|| self.sf.external_src.get().and_then(|src| src.get_source())) .and_then(|x| x.get(self.range.clone())) }