File tree Expand file tree Collapse file tree 1 file changed +2
-8
lines changed Expand file tree Collapse file tree 1 file changed +2
-8
lines changed Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ fn parse_features(path: &Path) -> Fallible<Vec<String>> {
53
53
let contents = :: std:: fs:: read_to_string ( path) ?;
54
54
for ( hash_idx, _) in contents. match_indices ( '#' ) {
55
55
let contents = & contents[ hash_idx + 1 ..] ;
56
- let contents = eat_token ( Some ( contents) , "!" ) . or_else ( || Some ( contents) ) ;
56
+ let contents = eat_token ( Some ( contents) , "!" ) . or ( Some ( contents) ) ;
57
57
let contents = eat_token ( contents, "[" ) ;
58
58
let contents = eat_token ( contents, "feature" ) ;
59
59
let new_features = parse_list ( contents, "(" , ")" ) ;
@@ -72,13 +72,7 @@ fn is_hidden(entry: &DirEntry) -> bool {
72
72
}
73
73
74
74
fn eat_token < ' a > ( s : Option < & ' a str > , tok : & str ) -> Option < & ' a str > {
75
- eat_whitespace ( s) . and_then ( |s| {
76
- if s. starts_with ( tok) {
77
- Some ( & s[ tok. len ( ) ..] )
78
- } else {
79
- None
80
- }
81
- } )
75
+ eat_whitespace ( s) . and_then ( |s| s. strip_prefix ( tok) )
82
76
}
83
77
84
78
fn eat_whitespace ( s : Option < & str > ) -> Option < & str > {
You can’t perform that action at this time.
0 commit comments