After my previous post I came across other ways to “quickly test rust code”
Obvious being rust-script
It is easy to install via cargo install rust-script (But I had it already
installed. I think Espanso installed it, but not too sure)
This may be better than rustc because one can define the dependencies in the
“script” itself, like :
#!/usr/bin/env rust-script
//! Dependencies can be specified in the script file itself as follows:
//!
//! ```cargo
//! [dependencies]
//! rand = "0.8.0"
//! ```
Start the file by specifying rust-script in the shebang line, so that shell knows what program to use for running this code