@@ -174,8 +174,24 @@ impl FromStr for ParsedToolchainDesc {
174
174
}
175
175
}
176
176
177
+ // These versions don't have v2 manifests, but they don't have point releases either,
178
+ // so to make the two-part version numbers work for these versions, specially turn
179
+ // them into their corresponding ".0" version.
180
+ let channel = match c. get ( 1 ) . unwrap ( ) . as_str ( ) {
181
+ "1.0" => "1.0.0" ,
182
+ "1.1" => "1.1.0" ,
183
+ "1.2" => "1.2.0" ,
184
+ "1.3" => "1.3.0" ,
185
+ "1.4" => "1.4.0" ,
186
+ "1.5" => "1.5.0" ,
187
+ "1.6" => "1.6.0" ,
188
+ "1.7" => "1.7.0" ,
189
+ "1.8" => "1.8.0" ,
190
+ other => other,
191
+ } ;
192
+
177
193
Self {
178
- channel : c . get ( 1 ) . unwrap ( ) . as_str ( ) . to_owned ( ) ,
194
+ channel : channel . to_owned ( ) ,
179
195
date : c. get ( 2 ) . map ( |s| s. as_str ( ) ) . and_then ( fn_map) ,
180
196
target : c. get ( 3 ) . map ( |s| s. as_str ( ) ) . and_then ( fn_map) ,
181
197
}
@@ -1019,6 +1035,16 @@ mod tests {
1019
1035
"0.0.0-0000-00-00-any-other-thing" ,
1020
1036
( "0.0.0" , Some ( "0000-00-00" ) , Some ( "any-other-thing" ) ) ,
1021
1037
) ,
1038
+ // special hardcoded cases that only have v1 manifests
1039
+ ( "1.0" , ( "1.0.0" , None , None ) ) ,
1040
+ ( "1.1" , ( "1.1.0" , None , None ) ) ,
1041
+ ( "1.2" , ( "1.2.0" , None , None ) ) ,
1042
+ ( "1.3" , ( "1.3.0" , None , None ) ) ,
1043
+ ( "1.4" , ( "1.4.0" , None , None ) ) ,
1044
+ ( "1.5" , ( "1.5.0" , None , None ) ) ,
1045
+ ( "1.6" , ( "1.6.0" , None , None ) ) ,
1046
+ ( "1.7" , ( "1.7.0" , None , None ) ) ,
1047
+ ( "1.8" , ( "1.8.0" , None , None ) ) ,
1022
1048
] ;
1023
1049
1024
1050
for ( input, ( channel, date, target) ) in success_cases {
0 commit comments