Tutorial by Examples

Firstly, you'll need to add the crate into your Cargo.toml file as a dependency. [dependencies] rand = "0.3" This will retrieve the rand crate from crates.io. Next, add this to your crate root. extern crate rand; As this example is going to provide a simple output through the term...
To generate characters, you can utilize the thread-local random number generator function, random. fn main() { let tuple = rand::random::<(f64, char)>(); println!("{:?}", tuple) } For occasional or singular requests, such as the one above, this is a reasonable efficien...

Page 1 of 1