Skip to content

Commit b1bd44d

Browse files
committed
Auto merge of #13371 - epage:new-comment, r=weihanglo
fix(new): Print a note, rather than a comment, for more information ### What does this PR try to resolve? For myself, I find it frustrating when tools add boilerplate that I have to remove after every use. A `note:` on the command-line is more ephemeral, helping people who need it while not interfering with those that don't. Fixes #12210 ### How should we test and review this PR? ### Additional information
2 parents 8e5e648 + 7513b41 commit b1bd44d

File tree

91 files changed

+73
-102
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

91 files changed

+73
-102
lines changed

src/cargo/ops/cargo_new.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -784,8 +784,7 @@ fn mk(config: &Config, opts: &MkOptions<'_>) -> CargoResult<()> {
784784
array.push(registry);
785785
manifest["package"]["publish"] = toml_edit::value(array);
786786
}
787-
let mut dep_table = toml_edit::Table::default();
788-
dep_table.decor_mut().set_prefix("\n# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html\n\n");
787+
let dep_table = toml_edit::Table::default();
789788
manifest["dependencies"] = toml_edit::Item::Table(dep_table);
790789

791790
// Calculate what `[lib]` and `[[bin]]`s we need to append to `Cargo.toml`.
@@ -911,6 +910,10 @@ mod tests {
911910
);
912911
}
913912

913+
config.shell().note(
914+
"see more `Cargo.toml` keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html",
915+
)?;
916+
914917
Ok(())
915918
}
916919

tests/testsuite/cargo_init/auto_git/out/Cargo.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,4 @@ name = "case"
33
version = "0.1.0"
44
edition = "2021"
55

6-
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
7-
86
[dependencies]
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
Creating library package
2+
note: see more `Cargo.toml` keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

tests/testsuite/cargo_init/bin_already_exists_explicit/out/Cargo.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,4 @@ name = "case"
33
version = "0.1.0"
44
edition = "2021"
55

6-
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
7-
86
[dependencies]
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
Creating binary (application) package
2+
note: see more `Cargo.toml` keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

tests/testsuite/cargo_init/bin_already_exists_explicit_nosrc/out/Cargo.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ name = "case"
33
version = "0.1.0"
44
edition = "2021"
55

6-
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
7-
86
[dependencies]
97

108
[[bin]]
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
Creating binary (application) package
2+
note: see more `Cargo.toml` keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

tests/testsuite/cargo_init/bin_already_exists_implicit/out/Cargo.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,4 @@ name = "case"
33
version = "0.1.0"
44
edition = "2021"
55

6-
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
7-
86
[dependencies]
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
Creating binary (application) package
2+
note: see more `Cargo.toml` keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

tests/testsuite/cargo_init/bin_already_exists_implicit_namenosrc/out/Cargo.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ name = "case"
33
version = "0.1.0"
44
edition = "2021"
55

6-
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
7-
86
[dependencies]
97

108
[[bin]]

0 commit comments

Comments
 (0)