Skip to content

Commit

Permalink
Fix tidy for the new syntax of feature declarations in libsyntax.
Browse files Browse the repository at this point in the history
  • Loading branch information
LeoTestard committed Apr 21, 2016
1 parent f0919ea commit c145db8
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/tools/tidy/src/features.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,18 +136,18 @@ fn collect_lang_features(path: &Path) -> Vec<Feature> {

let mut features = Vec::new();
for line in contents.lines().map(|l| l.trim()) {
if !STATUSES.iter().any(|s| line.contains(s) && line.starts_with("(")) {
if !STATUSES.iter().any(|s| line.starts_with(format!("({}", s))) {
continue
}
let mut parts = line.split(",");
let name = parts.next().unwrap().replace("\"", "").replace("(", "");
let since = parts.next().unwrap().trim().replace("\"", "");
let status = match parts.skip(1).next().unwrap() {
s if s.contains("Active") => "unstable",
s if s.contains("Removed") => "unstable",
s if s.contains("Accepted") => "stable",
let status = match parts.next().unwrap().trim().replace("(", "") {
"active" => "unstable",
"removed" => "unstable",
"accepted" => "stable",
s => panic!("unknown status: {}", s),
};
let name = parts.next().unwrap().trim();
let since = parts.next().unwrap().trim().replace("\"", "");

features.push(Feature {
name: name,
Expand Down

0 comments on commit c145db8

Please sign in to comment.