File tree Expand file tree Collapse file tree 2 files changed +28
-2
lines changed Expand file tree Collapse file tree 2 files changed +28
-2
lines changed Original file line number Diff line number Diff line change 88 strategy :
99 matrix :
1010 os : [ubuntu-latest, macos-latest, windows-latest]
11- rust : ["1.47 .0", "stable"]
11+ rust : ["1.54 .0", "stable"]
1212 runs-on : ${{ matrix.os }}
1313 steps :
1414 - name : Checkout source
Original file line number Diff line number Diff line change 33[ ![ Crates.io] ( https://img.shields.io/crates/v/rust-script.svg )] ( https://crates.io/crates/rust-script )
44
55# rust-script
6- Run Rust files and expressions without any setup or compilation necessary.
6+ Run Rust files and expressions without any setup or explicit compilation step, with seamless use of crates specified in the script file.
7+
8+ ``` sh
9+ $ cargo install script-script
10+ [...]
11+
12+ $ cat script.rs
13+ #! /usr/bin/env rust-script
14+ //! Dependencies can be specified in the script file itself as follows:
15+ //!
16+ //! ` ` ` cargo
17+ //! [dependencies]
18+ //! rand = " 0.8.0"
19+ //! ` ` `
20+
21+ use rand::prelude::* ;
22+
23+ fn main () {
24+ let x: u64 = random ();
25+ println! (" A random number: {}" , x);
26+ }
27+
28+ $ ./script.rs
29+ A random number: 9240261453149857564
30+ ```
31+
32+ Rust version 1.54 or newer required.
733
834See the [ documentation at rust-script.org] ( https://rust-script.org ) .
935
You can’t perform that action at this time.
0 commit comments