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 8
8
strategy :
9
9
matrix :
10
10
os : [ubuntu-latest, macos-latest, windows-latest]
11
- rust : ["1.47 .0", "stable"]
11
+ rust : ["1.54 .0", "stable"]
12
12
runs-on : ${{ matrix.os }}
13
13
steps :
14
14
- name : Checkout source
Original file line number Diff line number Diff line change 3
3
[ ![ Crates.io] ( https://img.shields.io/crates/v/rust-script.svg )] ( https://crates.io/crates/rust-script )
4
4
5
5
# 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.
7
33
8
34
See the [ documentation at rust-script.org] ( https://rust-script.org ) .
9
35
You can’t perform that action at this time.
0 commit comments