From c874c4e6926dcf217248e90f6e5ada8fd23c040b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danny=20M=C3=B6sch?= Date: Fri, 9 Feb 2024 23:34:26 +0100 Subject: [PATCH] Make use of marker protocol (#5463) --- .../Rules/Lint/LowerACLThanParentRule.swift | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/Source/SwiftLintBuiltInRules/Rules/Lint/LowerACLThanParentRule.swift b/Source/SwiftLintBuiltInRules/Rules/Lint/LowerACLThanParentRule.swift index a9043a094..8afc10498 100644 --- a/Source/SwiftLintBuiltInRules/Rules/Lint/LowerACLThanParentRule.swift +++ b/Source/SwiftLintBuiltInRules/Rules/Lint/LowerACLThanParentRule.swift @@ -178,18 +178,6 @@ private extension Syntax { } var modifiers: DeclModifierListSyntax? { - if let node = self.as(StructDeclSyntax.self) { - return node.modifiers - } else if let node = self.as(ClassDeclSyntax.self) { - return node.modifiers - } else if let node = self.as(ActorDeclSyntax.self) { - return node.modifiers - } else if let node = self.as(EnumDeclSyntax.self) { - return node.modifiers - } else if let node = self.as(ExtensionDeclSyntax.self) { - return node.modifiers - } else { - return nil - } + asProtocol((any WithModifiersSyntax).self)?.modifiers } }