~jplatte/turbo.fish

ref: 377fe15288c9495ce5d4ce5da1f301c718dbea52 turbo.fish/src/random.rs -rw-r--r-- 358 bytes
377fe152 — Jonas Platte Add /random, where you get a random turbofish! 3 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
use rand::{self, Rng};

static TYPES: &[&str] = &[
    "bool",
    "char",
    "i8",
    "i16",
    "i32",
    "i64",
    "isize",
    "u8",
    "u16",
    "u32",
    "u64",
    "usize",
    "f32",
    "f64",
    "&str",
    "String",
    "Vec<_>",
    "HashMap<_>",
];

pub fn random_type() -> &'static str {
    rand::thread_rng().choose(TYPES).unwrap()
}