|
1 year ago | |
---|---|---|
source | 1 year ago | |
.gitignore | 2 years ago | |
Cargo.lock | 2 years ago | |
Cargo.toml | 1 year ago | |
LICENSE | 1 year ago | |
README.md | 1 year ago | |
rustfmt.toml | 2 years ago |
A template for binary executable Rust projects.
AKA personal preferences.
source/
instead of src/
directory.Result<(), Box<dyn Error>>
return type for the ?
operator.The command below will:
new-project
.rust-bin-template
in Cargo.toml
with new-project
.git clone "https://git.holllo.cc/Bauke/rust-bin-template.git" new-project &&
cd $_ &&
rm -rf .git/ &&
git init &&
sed -i "s|rust-bin-template|$1|" "Cargo.toml"
Add this to your .bashrc
, .zshrc
(or similar) configuration so you don’t have to copy-paste that whole command every time.
new-rust-bin () {
git clone "https://git.holllo.cc/Bauke/rust-bin-template.git" "$1" &&
cd "$1" &&
rm -rf .git/ &&
git init &&
sed -i "s|rust-bin-template|$1|" "Cargo.toml"
}
Then use it as new-rust-bin new-project
.
Open-sourced with the Unlicense.