Skip to content

Commit 185c695

Browse files
authored
Fix formatting of CliUnstable parsing (#15434)
Because the last string in this match statement was over 100 characters, it prevented rustfmt from formatting the entire thing. By wrapping it, that allows rustfmt to do its job.
2 parents d811228 + 5bf2f85 commit 185c695

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

src/cargo/core/features.rs

+9-8
Original file line numberDiff line numberDiff line change
@@ -1279,10 +1279,8 @@ impl CliUnstable {
12791279
"feature-unification" => self.feature_unification = parse_empty(k, v)?,
12801280
"gc" => self.gc = parse_empty(k, v)?,
12811281
"git" => {
1282-
self.git = v.map_or_else(
1283-
|| Ok(Some(GitFeatures::all())),
1284-
|v| parse_git(v.split(',')),
1285-
)?
1282+
self.git =
1283+
v.map_or_else(|| Ok(Some(GitFeatures::all())), |v| parse_git(v.split(',')))?
12861284
}
12871285
"gitoxide" => {
12881286
self.gitoxide = v.map_or_else(
@@ -1297,7 +1295,7 @@ impl CliUnstable {
12971295
// can also be set in .cargo/config or with and ENV
12981296
"mtime-on-use" => self.mtime_on_use = parse_empty(k, v)?,
12991297
"no-index-update" => self.no_index_update = parse_empty(k, v)?,
1300-
"package-workspace" => self.package_workspace= parse_empty(k, v)?,
1298+
"package-workspace" => self.package_workspace = parse_empty(k, v)?,
13011299
"panic-abort-tests" => self.panic_abort_tests = parse_empty(k, v)?,
13021300
"public-dependency" => self.public_dependency = parse_empty(k, v)?,
13031301
"profile-rustflags" => self.profile_rustflags = parse_empty(k, v)?,
@@ -1315,10 +1313,13 @@ impl CliUnstable {
13151313
"target-applies-to-host" => self.target_applies_to_host = parse_empty(k, v)?,
13161314
"unstable-options" => self.unstable_options = parse_empty(k, v)?,
13171315
"warnings" => self.warnings = parse_empty(k, v)?,
1318-
_ => bail!("\
1316+
_ => bail!(
1317+
"\
13191318
unknown `-Z` flag specified: {k}\n\n\
1320-
For available unstable features, see https://doc.rust-lang.org/nightly/cargo/reference/unstable.html\n\
1321-
If you intended to use an unstable rustc feature, try setting `RUSTFLAGS=\"-Z{k}\"`"),
1319+
For available unstable features, see \
1320+
https://doc.rust-lang.org/nightly/cargo/reference/unstable.html\n\
1321+
If you intended to use an unstable rustc feature, try setting `RUSTFLAGS=\"-Z{k}\"`"
1322+
),
13221323
}
13231324

13241325
Ok(())

0 commit comments

Comments
 (0)