Skip to content

Commit

Permalink
Add dependency header in default Cargo.toml
Browse files Browse the repository at this point in the history
Almost any project beyond "hello world" will have some dependencies.
Including the `[dependencies]` header by default makes this slightly
simpler.

For new users of the language, this can potentially save some
frustration since crates.io currently does not mention the header, just
the line that goes beneath it.

For all users, this makes adding the first dependency to a project less
of a special case than to subsequent dependencies.
  • Loading branch information
johshoff committed Nov 8, 2015
1 parent b01770c commit e708411
Showing 1 changed file with 2 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 @@ -147,6 +147,8 @@ r#"[package]
name = "{}"
version = "0.1.0"
authors = [{}]
[dependencies]
"#, name, toml::Value::String(author)).as_bytes()));

try!(fs::create_dir(&path.join("src")));
Expand Down

0 comments on commit e708411

Please sign in to comment.