14
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
this post was submitted on 22 Oct 2024
14 points (85.0% liked)
Rust
6029 readers
1 users here now
Welcome to the Rust community! This is a place to discuss about the Rust programming language.
Wormhole
Credits
- The icon is a modified version of the official rust logo (changing the colors to a gradient and black background)
founded 1 year ago
MODERATORS
It could be done with a one liner in the terminal but adding arguments when running the binary will be in the middle of the command, not at the end of the command.
Also the usecase for me is for sample scripts I have. This makes it easy to compile, run and delete the binary.
If it's useful to you, that is great.
Will rustc not just overwrite the old binary? If you are just doing a cleanup task, that's cool. If nuking the last binary is important, then just do it first:
rm ./code; rustc ./code.rs -o ./code; ./code -mah args
Or a makefile / justfile would be good too.
I put those on each directory and do
just run
to pick up the thing I was working on quickly.