mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-03 15:15:24 +00:00
Optimize
This commit is contained in:
parent
43f09ad36c
commit
e0100e63ae
5 changed files with 28 additions and 13 deletions
|
@ -15,7 +15,7 @@ pub enum CfgExpr {
|
|||
|
||||
impl CfgExpr {
|
||||
/// Fold the cfg by querying all basic `Atom` and `KeyValue` predicates.
|
||||
pub fn fold(&self, query: &impl Fn(&SmolStr, Option<&SmolStr>) -> bool) -> Option<bool> {
|
||||
pub fn fold(&self, query: &dyn Fn(&SmolStr, Option<&SmolStr>) -> bool) -> Option<bool> {
|
||||
match self {
|
||||
CfgExpr::Invalid => None,
|
||||
CfgExpr::Atom(name) => Some(query(name, None)),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue