You can also transform code like this into an "actual" early return, which will make Clippy happy, and reduce nesting:
fn foo() -> Option<u32> {
if early_return_condition {
return None;
}
some_other_calculation()
}
You can also transform code like this into an "actual" early return, which will make Clippy happy, and reduce nesting:
fn foo() -> Option<u32> {
if early_return_condition {
return None;
}
some_other_calculation()
}