Skip to content

Commit 3b907ea

Browse files
committed
use parens for clearer formatting
the first and second lines now each represent one approach to getting a `source`
1 parent 88bcf1c commit 3b907ea

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

clippy_utils/src/source.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -342,10 +342,7 @@ impl SourceFileRange {
342342
/// Attempts to get the text from the source file. This can fail if the source text isn't
343343
/// loaded.
344344
pub fn as_str(&self) -> Option<&str> {
345-
self.sf
346-
.src
347-
.as_ref()
348-
.map(|src| src.as_str())
345+
(self.sf.src.as_ref().map(|src| src.as_str()))
349346
.or_else(|| self.sf.external_src.get().and_then(|src| src.get_source()))
350347
.and_then(|x| x.get(self.range.clone()))
351348
}

0 commit comments

Comments
 (0)