mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 04:19:13 +00:00
remove unnecessary lazy evaluations
This commit is contained in:
parent
7530d76f00
commit
cc80c5bd07
31 changed files with 50 additions and 51 deletions
|
@ -140,7 +140,7 @@ impl Shift {
|
|||
| tt::Leaf::Punct(tt::Punct { id, .. })
|
||||
| tt::Leaf::Literal(tt::Literal { id, .. })) = leaf;
|
||||
|
||||
(id != tt::TokenId::unspecified()).then(|| id.0)
|
||||
(id != tt::TokenId::unspecified()).then_some(id.0)
|
||||
}
|
||||
};
|
||||
subtree.token_trees.iter().filter_map(filter).max()
|
||||
|
|
|
@ -273,7 +273,7 @@ fn parse_repeat(src: &mut TtIter<'_>) -> Result<(Option<Separator>, RepeatKind),
|
|||
_ => return Err(ParseError::InvalidRepeat),
|
||||
},
|
||||
};
|
||||
return Ok((has_sep.then(|| separator), repeat_kind));
|
||||
return Ok((has_sep.then_some(separator), repeat_kind));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue