When creating a new project with cargo new, I would like to have the Cargo.toml file automatically include a predefined authors field.
The Rust book said:
The next four lines set the configuration information Cargo needs to compile your program: the name, the version, who wrote it, and the edition of Rust to use. Cargo gets your name and email information from your environment, so if that information is not correct, fix the information now and then save the file.
It was pretty vague, so I searched about it. First I tried adding CARGO_NAME and CARGO_EMAIL to my environment variables. Didn't work.
Then I tried adding the variables name and email in the field [cargo-new], on the .cargo/config.toml config file and learned it is deprecated.
Are there any other ways to do this? Did I do something wrong?
[package]
name = "hello_world"
version = "0.1.0"
edition = "2018"
authors = ["foo <bar@gmail.com>"] # Add this line automatically
[dependencies]
I'm using rustup with the nightly toolchain on Arch Linux.