Skip to content

Commit 2762dcd

Browse files
committed
Revert fmt
1 parent ca0cce7 commit 2762dcd

File tree

1 file changed

+37
-39
lines changed

1 file changed

+37
-39
lines changed

src/cargo/core/workspace.rs

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

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() => {
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.
12511268
let feats = CliFeatures {
1252-
features: Rc::new(cwd_features.clone()),
1269+
features: Rc::new(
1270+
member_specific_features
1271+
.remove(member.name().as_str())
1272+
.unwrap_or_default(),
1273+
),
1274+
uses_default_features: true,
12531275
all_features: cli_features.all_features,
1254-
uses_default_features: cli_features.uses_default_features,
12551276
};
12561277
Some((member, feats))
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-
}
1278+
} else {
1279+
// This member was not requested on the command-line, skip.
1280+
None
12841281
}
12851282
}
1286-
})
1287-
.collect();
1283+
}
1284+
})
1285+
.collect();
12881286

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

0 commit comments

Comments
 (0)