Crate bail_macros
source · [−]Expand description
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!");
Macros
break false
if input is Option::None
break false
if input is Result::Err
break None
if input is Option::None
break None
if input is Result::Err
break
if input is Option::None
break
if input is Result::Err
break true
if input is Option::None
break true
if input is Result::Err
continue
if input is Option::None
continue
if input is Result::Err
return false
if input is Option::None
return false
if input is Result::Err
return None
if input is Option::None
return None
if input is Result::Err
return
if input is Option::None
return
if input is Result::Err
return true
if input is Option::None
return true
if input is Result::Err