Skip to content

Commit d8a22a7

Browse files
dimblebyCopilot
andcommitted
Fix clippy::collapsible_match in ObjC interface parsing
`cargo clippy -- -D warnings` was failing on stable with a collapsible_match lint in ObjCInterface::from_ty: a nested `if` inside a `CXCursor_ObjCClassRef` match arm should be expressed as a match guard. Collapse it as suggested. No behaviour change. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 937b8d0 commit d8a22a7

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

bindgen/ir/objc.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -134,13 +134,13 @@ impl ObjCInterface {
134134

135135
cursor.visit(|c| {
136136
match c.kind() {
137-
CXCursor_ObjCClassRef => {
138-
if cursor.kind() == CXCursor_ObjCCategoryDecl {
139-
// We are actually a category extension, and we found the reference
140-
// to the original interface, so name this interface appropriately
141-
interface.name = c.spelling();
142-
interface.category = Some(cursor.spelling());
143-
}
137+
CXCursor_ObjCClassRef
138+
if cursor.kind() == CXCursor_ObjCCategoryDecl =>
139+
{
140+
// We are actually a category extension, and we found the reference
141+
// to the original interface, so name this interface appropriately
142+
interface.name = c.spelling();
143+
interface.category = Some(cursor.spelling());
144144
}
145145
CXCursor_ObjCProtocolRef => {
146146
// Gather protocols this interface conforms to

0 commit comments

Comments
 (0)