2 stable releases
2.0.0 | Apr 23, 2022 |
---|---|
1.0.0 | Apr 21, 2022 |
#2732 in Rust patterns
6KB
yeet!
Replace return Err(x)
and return None
with:
fn foo() -> Option<u32> {
yeet!();
}
fn bar() -> Result<u32, u32> {
yeet!(42);
}
fn baz(x: u32) -> Result<u32, u32> {
if x % 2 == 1 {
yeet!(x);
}
Ok(x)
}
That's pretty much it.
lib.rs
:
Poor man's yeet
keyword on stable.