Skip to content

Commit 705009e

Browse files
committed
Auto merge of #7129 - ehuss:string-reformat, r=Eh2406
Fix some formatting for some strings. Some of these strings were formatted in a strange way by rustfmt. Also fixed some strings missing trailing backslashes. Specifically, the "path override for crate" string, and the strings in `http_auth_offered`.
2 parents 0dd7c50 + a4e9611 commit 705009e

File tree

21 files changed

+60
-118
lines changed

21 files changed

+60
-118
lines changed

crates/resolver-tests/tests/resolve.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1273,8 +1273,7 @@ fn resolving_but_no_exists() {
12731273

12741274
assert_eq!(
12751275
res.err().unwrap().to_string(),
1276-
"\
1277-
no matching package named `foo` found\n\
1276+
"no matching package named `foo` found\n\
12781277
location searched: registry `https://example.com/`\n\
12791278
required by package `root v1.0.0 (registry `https://example.com/`)`\
12801279
"

src/bin/cargo/commands/metadata.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@ pub fn exec(config: &mut Config, args: &ArgMatches<'_>) -> CliResult {
3131
let version = match args.value_of("format-version") {
3232
None => {
3333
config.shell().warn(
34-
"\
35-
please specify `--format-version` flag explicitly \
34+
"please specify `--format-version` flag explicitly \
3635
to avoid compatibility problems",
3736
)?;
3837
1

src/cargo/core/package.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,8 +204,7 @@ impl Package {
204204
let manifest = self.manifest().original().prepare_for_publish(config)?;
205205
let toml = toml::to_string(&manifest)?;
206206
Ok(format!(
207-
"\
208-
# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO\n\
207+
"# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO\n\
209208
#\n\
210209
# When uploading crates to the registry Cargo will automatically\n\
211210
# \"normalize\" Cargo.toml files for maximal compatibility\n\

src/cargo/core/registry.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -387,8 +387,7 @@ https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html#overridin
387387
continue;
388388
}
389389
let msg = format!(
390-
"\
391-
path override for crate `{}` has altered the original list of\n\
390+
"path override for crate `{}` has altered the original list of\n\
392391
dependencies; the dependency on `{}` was either added or\n\
393392
modified to not match the previously resolved version\n\n\
394393
{}",
@@ -402,10 +401,9 @@ https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html#overridin
402401

403402
if let Some(dep) = real_deps.get(0) {
404403
let msg = format!(
405-
"\
406-
path override for crate `{}` has altered the original list of
407-
dependencies; the dependency on `{}` was removed\n\n
408-
{}",
404+
"path override for crate `{}` has altered the original list of\n\
405+
dependencies; the dependency on `{}` was removed\n\n\
406+
{}",
409407
override_summary.package_id().name(),
410408
dep.package_name(),
411409
boilerplate

src/cargo/ops/registry.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -269,8 +269,7 @@ fn transmit(
269269
Ok(warnings) => {
270270
if !warnings.invalid_categories.is_empty() {
271271
let msg = format!(
272-
"\
273-
the following are not valid category slugs and were \
272+
"the following are not valid category slugs and were \
274273
ignored: {}. Please see https://crates.io/category_slugs \
275274
for the list of all category slugs. \
276275
",
@@ -281,8 +280,7 @@ fn transmit(
281280

282281
if !warnings.invalid_badges.is_empty() {
283282
let msg = format!(
284-
"\
285-
the following are not valid badges and were ignored: {}. \
283+
"the following are not valid badges and were ignored: {}. \
286284
Either the badge type specified is unknown or a required \
287285
attribute is missing. Please see \
288286
https://doc.rust-lang.org/cargo/reference/manifest.html#package-metadata \

src/cargo/sources/directory.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,8 +176,7 @@ impl<'cfg> Source for DirectorySource<'cfg> {
176176
.finish_hex();
177177
if &*actual != cksum {
178178
failure::bail!(
179-
"\
180-
the listed checksum of `{}` has changed:\n\
179+
"the listed checksum of `{}` has changed:\n\
181180
expected: {}\n\
182181
actual: {}\n\
183182
\n\

src/cargo/util/command_prelude.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,7 @@ pub trait AppExt: Sized {
152152
self._arg(
153153
opt(
154154
"vcs",
155-
"\
156-
Initialize a new repository for the given version \
155+
"Initialize a new repository for the given version \
157156
control system (git, hg, pijul, or fossil) or do not \
158157
initialize any version control at all (none), overriding \
159158
a global configuration.",

src/cargo/util/diagnostic_server.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@ use crate::util::{Config, ProcessBuilder};
1818

1919
const DIAGNOSICS_SERVER_VAR: &str = "__CARGO_FIX_DIAGNOSTICS_SERVER";
2020
const PLEASE_REPORT_THIS_BUG: &str =
21-
"\
22-
This likely indicates a bug in either rustc or cargo itself,\n\
21+
"This likely indicates a bug in either rustc or cargo itself,\n\
2322
and we would appreciate a bug report! You're likely to see \n\
2423
a number of compiler warnings after this message which cargo\n\
2524
attempted to fix but failed. If you could open an issue at\n\

tests/testsuite/bad_config.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1149,8 +1149,7 @@ fn ignored_git_revision() {
11491149
foo.cargo("build -v")
11501150
.with_status(101)
11511151
.with_stderr_contains(
1152-
"\
1153-
[WARNING] key `branch` is ignored for dependency (bar). \
1152+
"[WARNING] key `branch` is ignored for dependency (bar). \
11541153
This will be considered an error in future versions",
11551154
)
11561155
.run();

tests/testsuite/build.rs

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4249,20 +4249,17 @@ fn targets_selected_default() {
42494249
p.cargo("build -v")
42504250
// Binaries.
42514251
.with_stderr_contains(
4252-
"\
4253-
[RUNNING] `rustc --crate-name foo src/main.rs --color never --crate-type bin \
4252+
"[RUNNING] `rustc --crate-name foo src/main.rs --color never --crate-type bin \
42544253
--emit=[..]link[..]",
42554254
)
42564255
// Benchmarks.
42574256
.with_stderr_does_not_contain(
4258-
"\
4259-
[RUNNING] `rustc --crate-name foo src/main.rs --color never --emit=[..]link \
4257+
"[RUNNING] `rustc --crate-name foo src/main.rs --color never --emit=[..]link \
42604258
-C opt-level=3 --test [..]",
42614259
)
42624260
// Unit tests.
42634261
.with_stderr_does_not_contain(
4264-
"\
4265-
[RUNNING] `rustc --crate-name foo src/main.rs --color never --emit=[..]link \
4262+
"[RUNNING] `rustc --crate-name foo src/main.rs --color never --emit=[..]link \
42664263
-C debuginfo=2 --test [..]",
42674264
)
42684265
.run();
@@ -4274,14 +4271,12 @@ fn targets_selected_all() {
42744271
p.cargo("build -v --all-targets")
42754272
// Binaries.
42764273
.with_stderr_contains(
4277-
"\
4278-
[RUNNING] `rustc --crate-name foo src/main.rs --color never --crate-type bin \
4274+
"[RUNNING] `rustc --crate-name foo src/main.rs --color never --crate-type bin \
42794275
--emit=[..]link[..]",
42804276
)
42814277
// Unit tests.
42824278
.with_stderr_contains(
4283-
"\
4284-
[RUNNING] `rustc --crate-name foo src/main.rs --color never --emit=[..]link \
4279+
"[RUNNING] `rustc --crate-name foo src/main.rs --color never --emit=[..]link \
42854280
-C debuginfo=2 --test [..]",
42864281
)
42874282
.run();
@@ -4293,14 +4288,12 @@ fn all_targets_no_lib() {
42934288
p.cargo("build -v --all-targets")
42944289
// Binaries.
42954290
.with_stderr_contains(
4296-
"\
4297-
[RUNNING] `rustc --crate-name foo src/main.rs --color never --crate-type bin \
4291+
"[RUNNING] `rustc --crate-name foo src/main.rs --color never --crate-type bin \
42984292
--emit=[..]link[..]",
42994293
)
43004294
// Unit tests.
43014295
.with_stderr_contains(
4302-
"\
4303-
[RUNNING] `rustc --crate-name foo src/main.rs --color never --emit=[..]link \
4296+
"[RUNNING] `rustc --crate-name foo src/main.rs --color never --emit=[..]link \
43044297
-C debuginfo=2 --test [..]",
43054298
)
43064299
.run();
@@ -4337,8 +4330,7 @@ fn no_linkable_target() {
43374330
.build();
43384331
p.cargo("build")
43394332
.with_stderr_contains(
4340-
"\
4341-
[WARNING] The package `the_lib` provides no linkable [..] \
4333+
"[WARNING] The package `the_lib` provides no linkable [..] \
43424334
while compiling `foo`. [..] in `the_lib`'s Cargo.toml. [..]",
43434335
)
43444336
.run();

0 commit comments

Comments
 (0)