Skip to content

Commit 18e1046

Browse files
committed
cleanup
1 parent cb8cac4 commit 18e1046

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

src/docbuilder/metadata.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -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
}

src/docbuilder/rustwide_builder.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ impl RustwideBuilder {
318318
let mut has_docs = false;
319319
let mut successful_targets = Vec::new();
320320
let metadata = Metadata::from_source_dir(&build.host_source_dir())?;
321-
let (default_target, other_targets) = metadata.select_extra_targets();
321+
let (default_target, other_targets) = metadata.targets();
322322

323323
// Do an initial build and then copy the sources in the database
324324
let res = self.execute_build(default_target, true, &build, &limits, &metadata)?;

0 commit comments

Comments
 (0)