use rand::Rng; /// Generates a random quote from a vec of &str present in the function body. pub fn get_quote() -> &'static str { // originally while dynamically server it would generate a new quote every time index would be // reloaded, but with static serve nature a new quote is written every new build. // Maybe not worth it. // feel free to remove let vs = vec![ "Silliness and tomfooler are afoot, and who am I to stop it.", "Low entropy self replicating phenomenon that generates a binding force called compassion.", "I was born in the late Holocene and I've seen some shit.", "If there's a deal meant for you, any wild place on earth will do.", "Live long and prosper.", "Prometheus they say brought gods fire down to man and we've caught it tamed it trained it since our history began.", "Guess we are doing Rust now", "If we want the rewards of being loved we have to submit to the mortifying ordeal of being known." ]; let mut rng = rand::thread_rng(); match vs.get(rng.gen_range(0..vs.len())) { Some(quote) => quote, None => "You have caught me off guard.", } }