Skip to content

Commit 3aa7137

Browse files
committed
Fix tidy for the new syntax of feature declarations in libsyntax.
1 parent ef1de51 commit 3aa7137

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/tools/tidy/src/features.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -136,18 +136,18 @@ fn collect_lang_features(path: &Path) -> Vec<Feature> {
136136

137137
let mut features = Vec::new();
138138
for line in contents.lines().map(|l| l.trim()) {
139-
if !STATUSES.iter().any(|s| line.contains(s) && line.starts_with("(")) {
139+
if !STATUSES.iter().any(|s| line.starts_with(&format!("({}", s))) {
140140
continue
141141
}
142142
let mut parts = line.split(",");
143-
let name = parts.next().unwrap().replace("\"", "").replace("(", "");
144-
let since = parts.next().unwrap().trim().replace("\"", "");
145-
let status = match parts.skip(1).next().unwrap() {
146-
s if s.contains("Active") => "unstable",
147-
s if s.contains("Removed") => "unstable",
148-
s if s.contains("Accepted") => "stable",
143+
let status = match &parts.next().unwrap().trim().replace("(", "")[..] {
144+
"active" => "unstable",
145+
"removed" => "unstable",
146+
"accepted" => "stable",
149147
s => panic!("unknown status: {}", s),
150148
};
149+
let name = parts.next().unwrap().trim();
150+
let since = parts.next().unwrap().trim().replace("\"", "");
151151

152152
features.push(Feature {
153153
name: name,

0 commit comments

Comments
 (0)