File tree 2 files changed +7
-12
lines changed
2 files changed +7
-12
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,6 @@ use std::{fs, path::PathBuf};
4
4
pub mod codegen;
5
5
mod flags;
6
6
use codegen:: grammar:: ast_src:: { AstNodeSrc , AstSrc , Field } ;
7
- use itertools:: Itertools ;
8
7
use std:: collections:: { BTreeMap , BTreeSet } ;
9
8
use std:: env;
10
9
use ungrammar:: Grammar ;
Original file line number Diff line number Diff line change @@ -560,16 +560,12 @@ impl<'a> Translator<'a> {
560
560
}
561
561
562
562
pub ( crate ) fn should_be_excluded ( & self , item : & impl ast:: HasAttrs ) -> bool {
563
- let Some ( sema) = self . semantics else {
564
- return false ;
565
- } ;
566
- for attr in item. attrs ( ) {
567
- if let Some ( ( name, tokens) ) = attr. as_simple_call ( ) {
568
- if name == "cfg" && sema. check_cfg_attr ( & tokens) == Some ( false ) {
569
- return true ;
570
- }
571
- }
572
- }
573
- false
563
+ self . semantics . is_some_and ( |sema| {
564
+ item. attrs ( ) . any ( |attr| {
565
+ attr. as_simple_call ( ) . is_some_and ( |( name, tokens) | {
566
+ name == "cfg" && sema. check_cfg_attr ( & tokens) == Some ( false )
567
+ } )
568
+ } )
569
+ } )
574
570
}
575
571
}
You can’t perform that action at this time.
0 commit comments