Skip to content

Commit 731d881

Browse files
committed
handle review comments
1 parent 2bef76a commit 731d881

File tree

3 files changed

+9
-18
lines changed

3 files changed

+9
-18
lines changed

crates/cargo-test-support/Cargo.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ authors = ["Alex Crichton <[email protected]>"]
55
license = "MIT OR Apache-2.0"
66
edition = "2018"
77

8-
build = "build.rs"
9-
108
[lib]
119
doctest = false
1210

src/cargo/core/compiler/build_context/target_info.rs

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -727,22 +727,15 @@ impl<'cfg> RustcTargetData<'cfg> {
727727
}));
728728
for kind in all_kinds {
729729
if let CompileKind::Target(target) = kind {
730-
match res.target_config.entry(target) {
731-
std::collections::hash_map::Entry::Occupied(_) => (),
732-
std::collections::hash_map::Entry::Vacant(place) => {
733-
place.insert(res.config.target_cfg_triple(target.short_name())?);
734-
}
730+
if !res.target_config.contains_key(&target) {
731+
res.target_config
732+
.insert(target, res.config.target_cfg_triple(target.short_name())?);
735733
}
736-
match res.target_info.entry(target) {
737-
std::collections::hash_map::Entry::Occupied(_) => (),
738-
std::collections::hash_map::Entry::Vacant(place) => {
739-
place.insert(TargetInfo::new(
740-
res.config,
741-
&res.requested_kinds,
742-
&res.rustc,
743-
kind,
744-
)?);
745-
}
734+
if !res.target_info.contains_key(&target) {
735+
res.target_info.insert(
736+
target,
737+
TargetInfo::new(res.config, &res.requested_kinds, &res.rustc, kind)?,
738+
);
746739
}
747740
}
748741
}

src/cargo/util/toml/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1322,7 +1322,7 @@ impl TomlManifest {
13221322
.default_target
13231323
.as_ref()
13241324
.map(|t| CompileTarget::new(&*t))
1325-
.transpose()? // TODO: anyhow::Context isn't imported yet so I guess .context() isn't the right way to do it?
1325+
.transpose()?
13261326
.map(CompileKind::Target);
13271327
let forced_kind = project
13281328
.forced_target

0 commit comments

Comments
 (0)