mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 12:54:58 +00:00
remove unnecessary lazy evaluations
This commit is contained in:
parent
7530d76f00
commit
cc80c5bd07
31 changed files with 50 additions and 51 deletions
|
@ -110,7 +110,7 @@ fn highlight_references(
|
|||
.and_then(|decl| decl.focus_range)
|
||||
.map(|range| {
|
||||
let category =
|
||||
references::decl_mutability(&def, node, range).then(|| ReferenceCategory::Write);
|
||||
references::decl_mutability(&def, node, range).then_some(ReferenceCategory::Write);
|
||||
HighlightedRange { range, category }
|
||||
});
|
||||
if let Some(hl_range) = hl_range {
|
||||
|
@ -365,7 +365,7 @@ mod tests {
|
|||
|
||||
let mut expected = annotations
|
||||
.into_iter()
|
||||
.map(|(r, access)| (r.range, (!access.is_empty()).then(|| access)))
|
||||
.map(|(r, access)| (r.range, (!access.is_empty()).then_some(access)))
|
||||
.collect::<Vec<_>>();
|
||||
|
||||
let mut actual = hls
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue