Skip to content

Commit d54d613

Browse files
committed
Run rustfmt
1 parent f0f912c commit d54d613

File tree

3 files changed

+24
-15
lines changed

3 files changed

+24
-15
lines changed

src/cargo/core/compiler/standard_lib.rs

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -150,18 +150,25 @@ pub fn generate_std_roots(
150150
// Generate a map of Units for each kind requested.
151151
let mut ret = HashMap::new();
152152

153-
let std_pkg_infos: Vec<_> = std_pkgs.iter().map(|pkg| {
154-
let lib = pkg
155-
.targets()
156-
.iter()
157-
.find(|t| t.is_lib())
158-
.expect("std has a lib");
159-
let unit_for = UnitFor::new_normal();
160-
let features = std_features.activated_features(pkg.package_id(), FeaturesFor::NormalOrDev);
161-
(pkg, lib, unit_for, features)
162-
}).collect();
153+
let std_pkg_infos: Vec<_> = std_pkgs
154+
.iter()
155+
.map(|pkg| {
156+
let lib = pkg
157+
.targets()
158+
.iter()
159+
.find(|t| t.is_lib())
160+
.expect("std has a lib");
161+
let unit_for = UnitFor::new_normal();
162+
let features =
163+
std_features.activated_features(pkg.package_id(), FeaturesFor::NormalOrDev);
164+
(pkg, lib, unit_for, features)
165+
})
166+
.collect();
163167

164-
for kinds in package_set.packages().map(|pkg| pkg.explicit_kinds(requested_kinds, explicit_host_kind)) {
168+
for kinds in package_set
169+
.packages()
170+
.map(|pkg| pkg.explicit_kinds(requested_kinds, explicit_host_kind))
171+
{
165172
for kind in kinds {
166173
if let Entry::Vacant(e) = ret.entry(kind) {
167174
let units = std_pkg_infos.iter().map(|(pkg, lib, unit_for, features)| {

src/cargo/core/package.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,11 @@ impl Package {
188188

189189
/// Returns explicit kinds either forced by `forced-target` in `Cargo.toml`,
190190
/// fallback to `default-target`, or specified in cli parameters.
191-
pub fn explicit_kinds(&self, requested_kinds: &[CompileKind], explicit_host_kind: CompileKind) -> Vec<CompileKind> {
191+
pub fn explicit_kinds(
192+
&self,
193+
requested_kinds: &[CompileKind],
194+
explicit_host_kind: CompileKind,
195+
) -> Vec<CompileKind> {
192196
if let Some(k) = self.manifest().forced_kind() {
193197
vec![k]
194198
} else {

tests/build-std/main.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -211,9 +211,7 @@ fn per_package_target() {
211211
)
212212
.build();
213213

214-
p.cargo("build -v")
215-
.build_std_arg("core")
216-
.run();
214+
p.cargo("build -v").build_std_arg("core").run();
217215
}
218216

219217
#[cargo_test(build_std)]

0 commit comments

Comments
 (0)