names::three::lowercase

Function rand_with

Source
pub fn rand_with(rng: &mut impl Rng) -> &'static str
Expand description

Selects a random name out of all three-letter lowercase names using a provided Random Number Generator (RNG).

§Arguments

  • rng: The random number generator (as an [Rng]) to use.

§Returns

A &'static str that refers to a random constant in this crate.

§Example

use names::three::lowercase::rand_with;

// Could print any of the `amy`, `bob`, `cho`, ... names!
println!("{}", rand_with(&mut rand::thread_rng()));