home ~ socials ~ projects ~ rss

Run A Rust File As A Script With cargo

May 2024

TODO: Make this a the basic example for a script. (Keeping here for right now because this is what shows up first in grimoire)

```cargo
[dependencies]
minijinja = { version= "2.0.1", features = ["debug", "loader"] }
```
cargo +nightly -Zscript ./script-name

Notes

  • You have to do ./ in front of the filename if it's not a .rs file.
end of line
Share link:
https://www.alanwsmith.com/en/2g/em/3j/la/?run-a-rust-file-as-a-script-with-cargo