1
Fork 0

Use ControlFlow results for visitors that are only looking for a single value

This commit is contained in:
Oli Scherer 2024-07-05 15:00:40 +00:00
parent d2e6cf7fa7
commit 7dca61b68b
6 changed files with 59 additions and 87 deletions

View file

@ -240,7 +240,7 @@ fn has_a_default_variant(item: &Annotatable) -> bool {
if v.attrs.iter().any(|attr| attr.has_name(kw::Default)) {
ControlFlow::Break(())
} else {
// no need to subrecurse.
// no need to walk the variant, we are only looking for top level variants
ControlFlow::Continue(())
}
}