File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -81,10 +81,10 @@ impl Cfg {
81
81
} ,
82
82
MetaItemKind :: List ( ref items) => {
83
83
let mut sub_cfgs = items. iter ( ) . map ( Cfg :: parse_nested) ;
84
- match & * name. as_str ( ) {
85
- " all" => sub_cfgs. fold ( Ok ( Cfg :: True ) , |x, y| Ok ( x? & y?) ) ,
86
- " any" => sub_cfgs. fold ( Ok ( Cfg :: False ) , |x, y| Ok ( x? | y?) ) ,
87
- " not" => if sub_cfgs. len ( ) == 1 {
84
+ match name {
85
+ sym :: all => sub_cfgs. fold ( Ok ( Cfg :: True ) , |x, y| Ok ( x? & y?) ) ,
86
+ sym :: any => sub_cfgs. fold ( Ok ( Cfg :: False ) , |x, y| Ok ( x? | y?) ) ,
87
+ sym :: not => if sub_cfgs. len ( ) == 1 {
88
88
Ok ( !sub_cfgs. next ( ) . unwrap ( ) ?)
89
89
} else {
90
90
Err ( InvalidCfgError {
Original file line number Diff line number Diff line change @@ -407,7 +407,7 @@ pub fn make_test(s: &str,
407
407
Ok ( Some ( item) ) => {
408
408
if !found_main {
409
409
if let ast:: ItemKind :: Fn ( ..) = item. node {
410
- if item. ident . as_str ( ) == " main" {
410
+ if item. ident . name == sym :: main {
411
411
found_main = true ;
412
412
}
413
413
}
You can’t perform that action at this time.
0 commit comments