Skip to content

Instantly share code, notes, and snippets.

@wpcarro
Created August 7, 2019 11:07
Show Gist options
  • Select an option

  • Save wpcarro/66cc146ed0669a110f94cb9ee9089ab0 to your computer and use it in GitHub Desktop.

Select an option

Save wpcarro/66cc146ed0669a110f94cb9ee9089ab0 to your computer and use it in GitHub Desktop.
Ergonomic way to run individual Rust files.
runrust() {
# Compile and run $1. Pass $1 as file.rs.
# This is modelled after the `runhaskell` command.
# Deletes the compiled binary after executing it.
#
# depends rustc
rustc "$1" && "./${1%.rs}" && rm "${1%.rs}"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment