@@ -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 ( ) . to_owned ( ) ;
150+ let since = parts. next ( ) . unwrap ( ) . trim ( ) . replace ( "\" " , "" ) ;
151151
152152 features. push ( Feature {
153153 name : name,
0 commit comments