We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 88bcf1c commit 3b907eaCopy full SHA for 3b907ea
clippy_utils/src/source.rs
@@ -342,10 +342,7 @@ impl SourceFileRange {
342
/// Attempts to get the text from the source file. This can fail if the source text isn't
343
/// loaded.
344
pub fn as_str(&self) -> Option<&str> {
345
- self.sf
346
- .src
347
- .as_ref()
348
- .map(|src| src.as_str())
+ (self.sf.src.as_ref().map(|src| src.as_str()))
349
.or_else(|| self.sf.external_src.get().and_then(|src| src.get_source()))
350
.and_then(|x| x.get(self.range.clone()))
351
}
0 commit comments