Rust template#
A repository template to get started with writing Rust projects.
Features#
- CI/CD support with Tangled
- Includes MIT & Apache-2.0 licenses for ecosystem compatibility (see Rust API Guidelines book)
Getting started#
Creating a new repository#
- Clone this repository template
- In the repository directory, remove
.gitfolder withrm -rf .git - In the repository directory, Initialize git repository with
git init .
Replace placeholders#
Replace the following placeholders with your editor's find-and-replace:
_library_- The name of the library._desc_- The description of the library._author_- The author's name of the library. For example, this could be a username, nickname, or real name._email_- The author's email address. This is optional and can be deleted.my_crate- Replace this with the name of your crate.
Configure#
| Tool | File path | Reference |
|---|---|---|
| Tangled CI | .tangled/workflows |
Reference |
| Cargo package | Cargo.toml |
Reference |
| Clippy (Linter) | .clippy.toml |
Repository, Reference |
| Rustfmt (Formatter) | .rustfmt.toml |
Repository, Reference |
Run scripts locally#
| Script | Command |
|---|---|
| Run tests | cargo test |
| Run Rustfmt | cargo fmt |
| Run Clippy | cargo clippy |
| Build crate documentation | cargo doc |
| Run security audits | cargo audit (with cargo-audit) |