Skip to content

Commit 7eb9e6c

Browse files
committed
Auto merge of #6881 - k-nasa:feature_cargo_toml_template, r=alexcrichton
Default Cargo.toml template provide help for completing the metadata ## Descriptio This is new Cargo.toml example. ```toml [package] name = "foo" version = "0.1.0" authors = ["k-nasa"] documentation = "" homepage = "" repository = "" readme = "" categories = [] keywords = [] license = "" edition = "2018" [dependencies] # See more https://doc.rust-lang.org/cargo/reference/manifest.html ``` ## Motivation close: #6845
2 parents ba5aac5 + f781d2d commit 7eb9e6c

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

src/cargo/ops/cargo_new.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -618,6 +618,8 @@ version = "0.1.0"
618618
authors = [{}]
619619
edition = {}
620620
{}
621+
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
622+
621623
[dependencies]
622624
{}"#,
623625
name,

tests/testsuite/new.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -522,3 +522,11 @@ fn new_with_blank_email() {
522522
let contents = fs::read_to_string(paths::root().join("foo/Cargo.toml")).unwrap();
523523
assert!(contents.contains(r#"authors = ["Sen"]"#), contents);
524524
}
525+
526+
#[test]
527+
fn new_with_reference_link() {
528+
cargo_process("new foo").env("USER", "foo").run();
529+
530+
let contents = fs::read_to_string(paths::root().join("foo/Cargo.toml")).unwrap();
531+
assert!(contents.contains("# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html"))
532+
}

0 commit comments

Comments
 (0)