home ~ projects ~ socials

Set Up Multiple Binaries In One Rust Project

It looks like you can just make multiple files in a src/bin directory like:

src/bin/example_name.rs

And then run or build them with the -- bin flag followed by their name. Like:

cargo run --bin example_name
cargo build --release --bin example_name
cargo watch -x 'run --bin example_name'
-- end of line --