about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorLeo Testard <leo.testard@gmail.com>2016-04-04 18:59:48 +0200
committerLeo Testard <leo.testard@gmail.com>2016-04-22 01:40:30 +0200
commit11f1eb0c4e2ff7e43052b4b847fb4dffaeea46b7 (patch)
tree528646d8a929418e959785f2fb3fff253fa64b85 /src
parentef1de519ff286a21e220d5839a6a5d468d296773 (diff)
downloadrust-11f1eb0c4e2ff7e43052b4b847fb4dffaeea46b7.tar.gz
rust-11f1eb0c4e2ff7e43052b4b847fb4dffaeea46b7.zip
Fix tidy for the new syntax of feature declarations in libsyntax.
Diffstat (limited to 'src')
-rw-r--r--src/tools/tidy/src/features.rs14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/tools/tidy/src/features.rs b/src/tools/tidy/src/features.rs
index 991cf201d44..0b989d92b3d 100644
--- a/src/tools/tidy/src/features.rs
+++ b/src/tools/tidy/src/features.rs
@@ -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().to_owned();
+        let since = parts.next().unwrap().trim().replace("\"", "");
 
         features.push(Feature {
             name: name,