Home
Head's Up: I'm in the middle of upgrading my site. Most things are in place, but there are something missing and/or broken including image alt text. Please bear with me while I'm getting things fixed.

Run A Single File As A Script With Rust

rust
#!/usr/bin/env cargo +nightly -Zscript

```cargo
[dependencies]
rand = "0.8.5"
```

use rand::prelude::*;

fn main() {
    let mut rng = rand::thread_rng();
    let num: u8 = rng.gen();
    println!("Random number: {}", num); 
}
results start

- The original version of the code had to have the code block lines prepended with [TODO: Code shorthand span ] .

- I'm removing those unnecessary [TODO: Code shorthand span ] comments from my site as I run across them

Footnotes And References