From c145db8450d37f74c4472b492b211e29c7a62cc7 Mon Sep 17 00:00:00 2001 From: Leo Testard Date: Mon, 4 Apr 2016 18:59:48 +0200 Subject: [PATCH] Fix tidy for the new syntax of feature declarations in libsyntax. --- src/tools/tidy/src/features.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/tools/tidy/src/features.rs b/src/tools/tidy/src/features.rs index 991cf201d44f0..9ad2e6a156530 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 { 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,