@@ -129,7 +129,8 @@ impl Metadata {
129129
130130 metadata
131131 }
132- pub ( super ) fn select_extra_targets < ' a : ' ret , ' b : ' ret , ' ret > ( & ' a self ) -> ( & ' ret str , Vec < & ' ret str > ) {
132+ // Return (default_target, all other targets that should be built with duplicates removed)
133+ pub ( super ) fn targets ( & self ) -> ( & str , Vec < & str > ) {
133134 use super :: rustwide_builder:: { HOST_TARGET , TARGETS } ;
134135 // Let people opt-in to only having specific targets
135136 // Ideally this would use Iterator instead of Vec so I could collect to a `HashSet`,
@@ -251,7 +252,7 @@ mod test {
251252
252253 let mut metadata = Metadata :: default ( ) ;
253254 // unchanged default_target, extra targets not specified
254- let ( default, tier_one) = metadata. select_extra_targets ( ) ;
255+ let ( default, tier_one) = metadata. targets ( ) ;
255256 assert_eq ! ( default , HOST_TARGET ) ;
256257 // should be equal to TARGETS \ {HOST_TARGET}
257258 for actual in & tier_one {
@@ -267,26 +268,26 @@ mod test {
267268
268269 // unchanged default_target, extra targets specified to be empty
269270 metadata. extra_targets = Some ( Vec :: new ( ) ) ;
270- let ( default, others) = metadata. select_extra_targets ( ) ;
271+ let ( default, others) = metadata. targets ( ) ;
271272 assert_eq ! ( default , HOST_TARGET ) ;
272273 assert ! ( others. is_empty( ) ) ;
273274
274275 // unchanged default_target, extra targets non-empty
275276 metadata. extra_targets = Some ( vec ! [ "i686-pc-windows-msvc" . into( ) , "i686-apple-darwin" . into( ) ] ) ;
276- let ( default, others) = metadata. select_extra_targets ( ) ;
277+ let ( default, others) = metadata. targets ( ) ;
277278 assert_eq ! ( default , "i686-pc-windows-msvc" ) ;
278279 assert_eq ! ( others. len( ) , 1 ) ;
279280 assert ! ( others. contains( & "i686-apple-darwin" ) ) ;
280281
281282 // make sure that default_target is not built twice
282283 metadata. extra_targets = Some ( vec ! [ HOST_TARGET . into( ) ] ) ;
283- let ( default, others) = metadata. select_extra_targets ( ) ;
284+ let ( default, others) = metadata. targets ( ) ;
284285 assert_eq ! ( default , HOST_TARGET ) ;
285286 assert ! ( others. is_empty( ) ) ;
286287
287288 // make sure that duplicates are removed
288289 metadata. extra_targets = Some ( vec ! [ "i686-pc-windows-msvc" . into( ) , "i686-pc-windows-msvc" . into( ) ] ) ;
289- let ( default, others) = metadata. select_extra_targets ( ) ;
290+ let ( default, others) = metadata. targets ( ) ;
290291 assert_eq ! ( default , "i686-pc-windows-msvc" ) ;
291292 assert ! ( others. is_empty( ) ) ;
292293 }
0 commit comments