This is a project template intended to be used with the cargo generate
command to simplify the process of publishing a repository written in
Rust.
There are two main ways to install {{project-name}}
, as explained
below:
The project can be installed using Cargo through the following steps:
- Install the Rust toolchain using the official guide.
- Run
cargo install --git https://github.com/{{gh-username}}/{{project-name}} --branch main
Alternatively, the compiled binaries can be found in the Releases page.
Assuming you have Cargo
installed, the simplest way to
use the template is through the cargo generate
tool, which can be
downloaded using the following command:
cargo install cargo-generate
Once installed, it can be used to generate a new project from the template as shown below:
cargo generate --git https://github.com/subreme/rust-template
Once the first command is run, a prompt will appear asking for the project's name. Once a name is selected, all placeholders in the project's files, outlined by double curly brackets, will be automatically replaced by their corresponding values.
Alternatively, the project name can be passed using the --name
flag,
as done in the underlined part of the example below:
cargo generate --git https://github.com/subreme/rust-template --name project-name
-------------------
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
See CONTRIBUTING.md.