rust-script 0.36.0

Command-line tool to run Rust "scripts" which can make use of crates.
1
2
3
4
5
6
7
8
9
10
11
12
use std::env;

mod script_module {
    include!(concat!(env!("RUST_SCRIPT_BASE_PATH"), "/script-module.rs"));
}

fn main() {
    println!("--output--");
    let s = include_str!(concat!(env!("RUST_SCRIPT_BASE_PATH"), "/file-to-be-included.txt"));
    assert_eq!(script_module::A_VALUE, 1);
    println!("{}", s);
}