Crates.io | xkcd_unreachable |
lib.rs | xkcd_unreachable |
version | 0.1.1 |
source | src |
created_at | 2020-03-16 05:20:02.437123 |
updated_at | 2020-03-16 06:05:05.167121 |
description | A Rust macro xkcd_unreachable!() inspired by https://xkcd.com/2200/ |
homepage | |
repository | https://github.com/io12/xkcd-unreachable-rs |
max_upload_size | |
id | 219166 |
size | 7,134 |
xkcd_unreachable
A Rust macro xkcd_unreachable!()
inspired by xkcd 2200
use xkcd_unreachable::xkcd_unreachable;
fn foo(x: Option<i32>) {
match x {
Some(n) if n >= 0 => println!("Some(Non-negative)"),
Some(n) if n < 0 => println!("Some(Negative)"),
Some(_) => xkcd_unreachable!(),
None => println!("None")
}
}
⚠ ERROR
If you're seeing this, the code is in what
I thought was an unreachable state.
I could give you advice for what to do.
But honestly, why should you trust me?
I clearly screwed this up. I'm writing a
message that should never appear, yet
I know it will probably appear someday.
On a deep level, I know I'm not
up to this task. I'm so sorry.
<https://xkcd.com/2200/>
For more information, see the documentation.