1 unstable release
0.1.0 | Mar 20, 2022 |
---|
#1647 in Rust patterns
11KB
285 lines
Bail Macros
Bail macros for Options, Results and more
Quick Example
use bail_macros::bob;
for i in 0..=20 {
println!("Index: {}", i);
bob!(None);
panic!("bob didn't break");
}
println!("cob broke out of the loop!");
lib.rs
:
Bail macros for Options, Results and more
Examples
use bail_macros::bob;
for i in 0..=20 {
println!("Index: {}", i);
bob!(None);
panic!("bob didn't break");
}
println!("cob broke out of the loop!");
use bail_macros::bob;
for i in 0..=20 {
println!("Index: {}", i);
bob!(Some(0));
panic!("bob didn't break");
}
println!("cob broke out of the loop!");