Skip to content

Commit

Permalink
Auto merge of #6881 - k-nasa:feature_cargo_toml_template, r=alexcrichton
Browse files Browse the repository at this point in the history
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
  • Loading branch information
bors committed May 2, 2019
2 parents ba5aac5 + f781d2d commit 7eb9e6c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/cargo/ops/cargo_new.rs
Original file line number Diff line number Diff line change
Expand Up @@ -618,6 +618,8 @@ version = "0.1.0"
authors = [{}]
edition = {}
{}
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
{}"#,
name,
Expand Down
8 changes: 8 additions & 0 deletions tests/testsuite/new.rs
Original file line number Diff line number Diff line change
Expand Up @@ -522,3 +522,11 @@ fn new_with_blank_email() {
let contents = fs::read_to_string(paths::root().join("foo/Cargo.toml")).unwrap();
assert!(contents.contains(r#"authors = ["Sen"]"#), contents);
}

#[test]
fn new_with_reference_link() {
cargo_process("new foo").env("USER", "foo").run();

let contents = fs::read_to_string(paths::root().join("foo/Cargo.toml")).unwrap();
assert!(contents.contains("# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html"))
}

0 comments on commit 7eb9e6c

Please sign in to comment.