I recommend using the CRUSTDE - Containerized Rust Development Environment to write Rust projects.
Follow the instructions here
https://github.com/CRUSTDE-ContainerizedRustDevEnvrustde_cnt_img_pod.
It is an isolated development environment that will not mess with you system. It will work on Linux (tested on Debian) and inside WSL (Windows Subsystem for Linux).
You just need to install the Docker newer alternative: Podman.
Then you download the prepared container image from DockerHub (3GB).
And then a little juggling with ssh keys.
All this is simplified by running a few bash scripts.
Just follow the easy instructions.
The container image contains cargo, rustc, wasm-pack, basic-http-server, cargo-auto and other utils that a Rust project needs.
Automation tasks that are already coded in the sub-project automation_tasks_rs
. This is a basic workflow:
cargo auto build
cargo auto release
cargo auto doc
cargo auto test
cargo auto commit_and push
cargo auto publish_to_crates_io
cargo auto github_new_release
Every task finishes with instructions how to proceed.
The cargo-auto and dev_bestia_cargo_completion are already installed inside the CRUSTDE container.
You can open the automation sub-project in VSCode and then code your own tasks in Rust.
code automation_tasks_rs
I am using the previous version of cargo-auto
to develop the next version. I added the automation_tasks_rs
folder and prepared the automation tasks that are used repetitively.
Inside the cargo-auto project, there are some Rust sub-projects that are templates. I can open a new editor for these directories and build these crates independently. So it is easy to debug and develop.
Sadly, I cannot publish these directories and files to crates.io
. I can effectively publish only the source code inside my main Rust project cargo-auto
.
Therefore, before publishing I copy the content of these files into the modules template_new_auto_for_cli_mod.rs
on every build. It is not difficult now that Rust has fantastic raw strings. For this repetitive task as always, I prepared an automation task in automation_tasks_rs
.