Skip to content

Commit 1839ded

Browse files
committed
Cargo fmt
1 parent 766c3bb commit 1839ded

File tree

1 file changed

+39
-37
lines changed

1 file changed

+39
-37
lines changed

src/cargo/core/workspace.rs

Lines changed: 39 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1240,49 +1240,51 @@ impl<'cfg> Workspace<'cfg> {
12401240
}
12411241
}
12421242

1243-
let ms: Vec<_> = self.members().filter_map(|member| {
1244-
let member_id = member.package_id();
1245-
match self.current_opt() {
1246-
// The features passed on the command-line only apply to
1247-
// the "current" package (determined by the cwd).
1248-
Some(current) if member_id == current.package_id() => {
1249-
let feats = CliFeatures {
1250-
features: Rc::new(cwd_features.clone()),
1251-
all_features: cli_features.all_features,
1252-
uses_default_features: cli_features.uses_default_features,
1253-
};
1254-
Some((member, feats))
1255-
}
1256-
_ => {
1257-
// Ignore members that are not enabled on the command-line.
1258-
if specs.iter().any(|spec| spec.matches(member_id)) {
1259-
// -p for a workspace member that is not the "current"
1260-
// one.
1261-
//
1262-
// The odd behavior here is due to backwards
1263-
// compatibility. `--features` and
1264-
// `--no-default-features` used to only apply to the
1265-
// "current" package. As an extension, this allows
1266-
// member-name/feature-name to set member-specific
1267-
// features, which should be backwards-compatible.
1243+
let ms: Vec<_> = self
1244+
.members()
1245+
.filter_map(|member| {
1246+
let member_id = member.package_id();
1247+
match self.current_opt() {
1248+
// The features passed on the command-line only apply to
1249+
// the "current" package (determined by the cwd).
1250+
Some(current) if member_id == current.package_id() => {
12681251
let feats = CliFeatures {
1269-
features: Rc::new(
1270-
member_specific_features
1271-
.remove(member.name().as_str())
1272-
.unwrap_or_default(),
1273-
),
1274-
uses_default_features: true,
1252+
features: Rc::new(cwd_features.clone()),
12751253
all_features: cli_features.all_features,
1254+
uses_default_features: cli_features.uses_default_features,
12761255
};
12771256
Some((member, feats))
1278-
} else {
1279-
// This member was not requested on the command-line, skip.
1280-
None
1257+
}
1258+
_ => {
1259+
// Ignore members that are not enabled on the command-line.
1260+
if specs.iter().any(|spec| spec.matches(member_id)) {
1261+
// -p for a workspace member that is not the "current"
1262+
// one.
1263+
//
1264+
// The odd behavior here is due to backwards
1265+
// compatibility. `--features` and
1266+
// `--no-default-features` used to only apply to the
1267+
// "current" package. As an extension, this allows
1268+
// member-name/feature-name to set member-specific
1269+
// features, which should be backwards-compatible.
1270+
let feats = CliFeatures {
1271+
features: Rc::new(
1272+
member_specific_features
1273+
.remove(member.name().as_str())
1274+
.unwrap_or_default(),
1275+
),
1276+
uses_default_features: true,
1277+
all_features: cli_features.all_features,
1278+
};
1279+
Some((member, feats))
1280+
} else {
1281+
// This member was not requested on the command-line, skip.
1282+
None
1283+
}
12811284
}
12821285
}
1283-
}
1284-
})
1285-
.collect();
1286+
})
1287+
.collect();
12861288

12871289
// If any member specific features were not removed while iterating over members
12881290
// some features will be ignored.

0 commit comments

Comments
 (0)