diff options
| author | Ada Alakbarova <ada.alakbarova@proton.me> | 2025-08-03 12:09:06 +0200 |
|---|---|---|
| committer | Ada Alakbarova <ada.alakbarova@proton.me> | 2025-08-03 17:16:28 +0200 |
| commit | 3b907eada71ea36710566e6fd22a268c42b55e94 (patch) | |
| tree | 54330b4f026429391c74059966af334411261864 /clippy_utils/src/source.rs | |
| parent | 88bcf1ca19236b2b51d55080d817e49ef2d8fd17 (diff) | |
use parens for clearer formatting
the first and second lines now each represent one approach to getting a `source`
Diffstat (limited to 'clippy_utils/src/source.rs')
| -rw-r--r-- | clippy_utils/src/source.rs | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/clippy_utils/src/source.rs b/clippy_utils/src/source.rs index 7d21336be1c..277b074ec58 100644 --- a/clippy_utils/src/source.rs +++ b/clippy_utils/src/source.rs @@ -342,10 +342,7 @@ impl SourceFileRange { /// Attempts to get the text from the source file. This can fail if the source text isn't /// loaded. pub fn as_str(&self) -> Option<&str> { - self.sf - .src - .as_ref() - .map(|src| src.as_str()) + (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())) } |
