Rebuilding on changes

When you're working on developing web servers, it's useful to have instant access to compiled and running applications. It's tiresome to have to restart cargo run manually whenever you change the code. I recommend that you install and use the cargo-watch subcommand on cargo. This will monitor the changes made to the files of your project and restart the other commands you have chosen.

To install cargo-watch, perform the following steps:

  1. Type the following command in the console:
cargo install cargo-watch
  1. Use the run command with watch:
cargo watch -x "run"

You can add extra arguments to the run command between quotes or add extra arguments after the -- characters.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.128.173.53