Skip to main content

run_rust_dir

Function run_rust_dir 

Source
pub fn run_rust_dir(dir: &Path, extra_args: &[String]) -> Result<(), String>
Expand description

Runs a directory of loose .rs files by generating a temporary Cargo project.

  1. Finds the entry file (containing fn main())
  2. Creates a cached Cargo project directory
  3. Copies the entry file as src/main.rs and all other files as src/<name>.rs
  4. Collects any embedded dependency manifests from all files
  5. Invokes cargo run --quiet