Rust-Script is a tool designed for executing Rust script files effortlessly, eliminating the need for setup or explicit compilation. It streamlines development by allowing developers to run scripts directly, enhancing productivity.
Key Features:
Seamless Dependency Management: Specify crates as dependencies directly within the script file, simplifying dependency handling.
Script and Expression Support: Enables running Rust files and expressions as scripts, facilitating quick prototyping and testing.
Install via Winget: Easily install Rust-Script using winget for a smooth setup experience.
Rust Version Compatibility: Requires Rust 1.74 or newer, ensuring compatibility with the latest language features.
Audience & Benefits:
Ideal for developers, DevOps professionals, educators, and students who value efficiency in scripting. Rust-Script accelerates development cycles by reducing setup time and enabling seamless integration of dependencies into scripts, making it a valuable tool for both prototyping and educational purposes.
README
rust-script
Run Rust script files without any setup or explicit compilation step, with seamless use of crates specified as dependencies inside the scripts.
$ cargo install rust-script
[...]
$ cat script.rs
#!/usr/bin/env rust-script
//! Dependencies can be specified in the script file itself as follows:
//!
//! ```cargo
//! [dependencies]
//! rand = "0.8.0"
//! ```
use rand::prelude::*;
fn main() {
let x: u64 = random();
println!("A random number: {}", x);
}
$ ./script.rs
A random number: 9240261453149857564