Rust auto reload with cargo watch
Nodemon
When I develop a node.js application, I don’t enter the run command since there is a nodemon that automatically restarting the application when file changes in the directory are detected. The same you can find in Rust is Cargo Watch.
cargo-watch
At first, you need to install the cargo-watch using this command.
$ cargo install cargo-watch
After the installation is ok, we can run it by hitting this command.
$ cargo watch [-x command]...
I found this when I read the actix-web official document. It seems that cargo watch applies to every Rust project.
For the actix-web project, I use this.
$ cargo watch -x run
Leave a comment