Crates.io | expecto-patronum |
lib.rs | expecto-patronum |
version | 0.1.0 |
source | src |
created_at | 2023-01-07 11:36:36.336174 |
updated_at | 2023-01-07 11:36:36.336174 |
description | A library to add beatiful animals to your panic outputs |
homepage | |
repository | https://github.com/arjentix/expecto-patronum |
max_upload_size | |
id | 753002 |
size | 21,917 |
I, Daniil Polyakov, hereby waive all rights to the code and resources distributed with this document that use elements from the Harry Potter universe and ASCII art. I understand that this code and resources are not sanctioned by, affiliated with, or endorsed by the Harry Potter rights holders or the creators of the ASCII art and I make no claims to the contrary. I acknowledge that the use of any intellectual property from the Harry Potter universe and ASCII art in my code and resources is for entertainment purposes only and falls under the doctrine of fair use. I make no claim to any rights in the Harry Potter universe or ASCII art and do not imply any endorsement or approval from the Harry Potter rights holders or the creators of the ASCII art. The waiver of rights applies to the Harry Potter elements and ASCII art in my code and resources and does not extend to the code itself. The code is distributed under MIT license.
This crate allows you to replace all expect(…)
with expecto_patronum(…)
which works in the same way but also prints a beautiful patronus with your panic message. Patronus animal depends on the message you provide.
Simple usage example:
use expecto_patronum::prelude::*;
let x = Some("Harry Potter");
assert_eq!(x.expecto_patronum("No dementors here"), "Harry Potter");
use expecto_patronum::prelude::*;
let x: Option<&str> = None;
x.expecto_patronum("No dementors here"); // panics with `No dementors here` and casts a patronus
Output of the last example:
thread 'main' panicked at '
_,
<\ `.
`. `~'^----.._ _
`. , _, `.`-. ' )
, ),'-~'( / ` .`-.___,-'
( /; `'\, `
_/' _// `.
' " ' " ' `
No dementors here
'
You can run
cargo run --example summon
And enter any line you want to get an example of generated animal.