Crates.io | lovecraft |
lib.rs | lovecraft |
version | 0.2.0 |
source | src |
created_at | 2019-04-12 13:20:10.618552 |
updated_at | 2019-04-12 13:36:59.25462 |
description | brings back the Lovecraft quotes on panic |
homepage | |
repository | https://github.com/Geal/lovecraft |
max_upload_size | |
id | 127456 |
size | 7,280 |
Long ago, every Rust program came with a set of Lovecraft quotes that would be displayed on panic. Unfortunately, for a lot of important reasons like making "hello world" programs smaller, they were removed.
Thankfully, this crate brings disorder and dread back into your programs.
With the following code:
extern crate lovecraft;
fn main() {
lovecraft::invoke();
panic!("Ph'nglui mglw'nafh Cthulhu R'lyeh wgah'nagl fhtagn");
}
This will print:
$ ./main
Ph'nglui mglw'nafh Cthulhu R'lyeh wgah'nagl fhtagn
It was from the artists and poets that the pertinent answers came, and I
know that panic would have broken loose had they been able to compare notes.
As it was, lacking their original letters, I half suspected the compiler of
having asked leading questions, or of having edited the correspondence in
corroboration of what he had latently resolved to see.
You can also choose your own quotes with the function: lovecraft::panic_quotes(quotes: &'static [&'static str], default: &'static str)